attestantio / dirk

Apache License 2.0
75 stars 22 forks source link

Copy slashing protection values on fetch. #6

Closed mcdee closed 3 years ago

mcdee commented 3 years ago

Copy all values obtained from the slashing protection database as they are returned. This avoids a potential overwrite situation when bulk fetching information, most notably when data is obtained for generating a slashing protection export.

This fixes an issue where --export-slashing-protection would sometimes provide erroneous information.

This change also explicitly closes the slashing protection database on exit, and holds the main goroutine open for a couple of seconds to ensure the close completes before shutting down Dirk. A log message is provided stating that the close succeeded (or not).