aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/agreement.go
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-02-27 10:41:01 +0800
committerWei-Ning Huang <w@byzantine-lab.io>2019-06-12 17:27:22 +0800
commit2b2396b6bce0f21b515ac2d38556f6dca08b1770 (patch)
tree60d6c93689b54534ecc88bd1491bd82fa372b541 /vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/agreement.go
parentedb1273cb08d56df41b30b1f2f2e113f9b4296e4 (diff)
downloadgo-tangerine-2b2396b6bce0f21b515ac2d38556f6dca08b1770.tar.gz
go-tangerine-2b2396b6bce0f21b515ac2d38556f6dca08b1770.tar.zst
go-tangerine-2b2396b6bce0f21b515ac2d38556f6dca08b1770.zip
core: sync to latest core (#214)
* vendor: sync to latest core * fix for single chain
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/agreement.go')
-rw-r--r--vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/agreement.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/agreement.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/agreement.go
index acc4f1c6c..9f1abcaf5 100644
--- a/vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/agreement.go
+++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/syncer/agreement.go
@@ -160,8 +160,10 @@ func (a *agreement) processNewCRS(round uint64) {
if round <= a.latestCRSRound {
return
}
+ prevRound := a.latestCRSRound + 1
+ a.latestCRSRound = round
// Verify all pending results.
- for r := a.latestCRSRound + 1; r <= round; r++ {
+ for r := prevRound; r <= a.latestCRSRound; r++ {
pendingsForRound := a.pendings[r]
if pendingsForRound == nil {
continue
@@ -169,7 +171,9 @@ func (a *agreement) processNewCRS(round uint64) {
delete(a.pendings, r)
for _, res := range pendingsForRound {
if err := core.VerifyAgreementResult(res, a.cache); err != nil {
- a.logger.Error("invalid agreement result", "result", res)
+ a.logger.Error("invalid agreement result",
+ "result", res,
+ "error", err)
continue
}
a.logger.Error("flush agreement result", "result", res)
@@ -177,7 +181,6 @@ func (a *agreement) processNewCRS(round uint64) {
break
}
}
- a.latestCRSRound = round
}
// confirm notifies consensus the confirmation of a block in BA.