Skip to content

Commit

Permalink
Close evidence.db OnStop (cometbft#1210)
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
  • Loading branch information
chillyvee authored Aug 8, 2023
1 parent cf23082 commit 48335a0
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 @@ -479,15 +479,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 48335a0

Please sign in to comment.