Skip to content

Commit

Permalink
Close evidence.db OnStop (celestiaorg#1210) (celestiaorg#1226)
Browse files Browse the repository at this point in the history
* CV OnStop close evidenceStore

* CV OnStop print db close

* CV add changelog

* CV update changelog with attribution

(cherry picked from commit 48335a0)

Co-authored-by: Chill Validation <[email protected]>
  • Loading branch information
mergify[bot] and chillyvee authored Aug 8, 2023
1 parent a389900 commit 8732989
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- `[node]` Close evidence.db OnStop ([cometbft/cometbft\#1210](https://github.com/cometbft/cometbft/pull/1210): @chillyvee)
8 changes: 8 additions & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -1069,15 +1069,23 @@ func (n *Node) OnStop() {
}
}
if n.blockStore != nil {
n.Logger.Info("Closing blockstore")
if err := n.blockStore.Close(); err != nil {
n.Logger.Error("problem closing blockstore", "err", err)
}
}
if n.stateStore != nil {
n.Logger.Info("Closing statestore")
if err := n.stateStore.Close(); err != nil {
n.Logger.Error("problem closing statestore", "err", err)
}
}
if n.evidencePool != nil {
n.Logger.Info("Closing evidencestore")
if err := n.EvidencePool().Close(); err != nil {
n.Logger.Error("problem closing evidencestore", "err", err)
}
}
}

// ConfigureRPC makes sure RPC has all the objects it needs to operate.
Expand Down

0 comments on commit 8732989

Please sign in to comment.