s/OnBlockchainTerminate/OnClose

This commit is contained in:
Chris Ziogas 2024-04-25 09:39:08 +03:00
parent a6541d2e57
commit a2639b2fde
No known key found for this signature in database
GPG key ID: 2329CF479E36E2DA
2 changed files with 9 additions and 13 deletions

View file

@ -1161,10 +1161,6 @@ func (bc *BlockChain) Stop() {
if err := bc.triedb.Close(); err != nil {
log.Error("Failed to close trie database", "err", err)
}
// Allow tracers to clean-up and release resources.
if bc.vmConfig.Tracer != nil && bc.vmConfig.Tracer.OnBlockchainTerminate != nil {
bc.vmConfig.Tracer.OnBlockchainTerminate()
}
log.Info("Blockchain stopped")
}

View file

@ -85,7 +85,7 @@ func newSupply(cfg json.RawMessage) (*tracing.Hooks, error) {
OnBalanceChange: t.OnBalanceChange,
OnEnter: t.OnEnter,
OnExit: t.OnExit,
OnBlockchainTerminate: t.OnBlockchainTerminate,
OnClose: t.OnClose,
}, nil
}
@ -230,7 +230,7 @@ func (s *supply) OnExit(depth int, output []byte, gasUsed uint64, err error, rev
s.txCallstack[size-1].calls = append(s.txCallstack[size-1].calls, call)
}
func (s *supply) OnBlockchainTerminate() {
func (s *supply) OnClose() {
if err := s.logger.Close(); err != nil {
log.Warn("failed to close supply tracer log file", "error", err)
}