diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-11-05 18:37:46 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:18 +0800 |
commit | 5db9884093fe8187fbf52bbdd96d4e166ab24a85 (patch) | |
tree | a07947fe5d001f1ae68b9ebb79cbeed35c4e0044 /vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go | |
parent | e16a22e896cc10c42c8353d6adba45652d3c13d9 (diff) | |
download | go-tangerine-5db9884093fe8187fbf52bbdd96d4e166ab24a85.tar go-tangerine-5db9884093fe8187fbf52bbdd96d4e166ab24a85.tar.gz go-tangerine-5db9884093fe8187fbf52bbdd96d4e166ab24a85.tar.bz2 go-tangerine-5db9884093fe8187fbf52bbdd96d4e166ab24a85.tar.lz go-tangerine-5db9884093fe8187fbf52bbdd96d4e166ab24a85.tar.xz go-tangerine-5db9884093fe8187fbf52bbdd96d4e166ab24a85.tar.zst go-tangerine-5db9884093fe8187fbf52bbdd96d4e166ab24a85.zip |
vendor: sync to latest core
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go index 2eed101c7..56c757b0d 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus.go @@ -159,6 +159,15 @@ func (recv *consensusBAReceiver) ConfirmBlock( recv.consensus.logger.Error("Failed to process block", "error", err) return } + // Clean the restartNotary channel so BA will not stuck by deadlock. +CleanChannelLoop: + for { + select { + case <-recv.restartNotary: + default: + break CleanChannelLoop + } + } if block.Timestamp.After(recv.changeNotaryTime) { recv.round++ recv.restartNotary <- true |