From 9691a8e4c672f3e25fed96b22759ddc7477bdd34 Mon Sep 17 00:00:00 2001 From: zjubfd <296179868@qq.com> Date: Sat, 2 Apr 2022 14:35:33 +0800 Subject: [PATCH] fix deadlock on miner module when failed to commit trie --- core/state/statedb.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index 2cdd757a22..76983b2a9c 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -1366,10 +1366,8 @@ func (s *StateDB) Commit(failPostCommitFunc func(), postCommitFuncs ...func() er // Write any contract code associated with the state object tasks <- func() { // Write any storage changes in the state object to its storage trie - if err := obj.CommitTrie(s.db); err != nil { - taskResults <- err - } - taskResults <- nil + err := obj.CommitTrie(s.db) + taskResults <- err } tasksNum++ }