package shutdowncheck
import "github.com/ethereum/go-ethereum/internal/shutdowncheck"
Index ¶
Types ¶
type ShutdownTracker ¶
type ShutdownTracker struct {
// contains filtered or unexported fields
}
ShutdownTracker is a service that reports previous unclean shutdowns upon start. It needs to be started after a successful start-up and stopped after a successful shutdown, just before the db is closed.
func NewShutdownTracker ¶
func NewShutdownTracker(db ethdb.Database) *ShutdownTracker
NewShutdownTracker creates a new ShutdownTracker instance and has no other side-effect.
func (*ShutdownTracker) MarkStartup ¶
func (t *ShutdownTracker) MarkStartup()
MarkStartup is to be called in the beginning when the node starts. It will: - Push a new startup marker to the db - Report previous unclean shutdowns
func (*ShutdownTracker) Start ¶
func (t *ShutdownTracker) Start()
Start runs an event loop that updates the current marker's timestamp every 5 minutes.
func (*ShutdownTracker) Stop ¶
func (t *ShutdownTracker) Stop()
Stop will stop the update loop and clear the current marker.
Source Files ¶
- Version
- v1.15.11 (latest)
- Published
- May 5, 2025
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 2 days ago –
Tools for package owners.