diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-12-13 11:12:59 +0800 |
---|---|---|
committer | Wei-Ning Huang <w@byzantine-lab.io> | 2019-06-12 17:27:19 +0800 |
commit | aa34cc1069a815ed66ec8fae0988fc4f29687bfd (patch) | |
tree | f771aed8714ed77d540f4c41578df94605aef03b /vendor/github.com/dexon-foundation/dexon-consensus/core/total-ordering.go | |
parent | 7a587feaa582fcecdcc0388f720e54614cb6b8f4 (diff) | |
download | go-tangerine-aa34cc1069a815ed66ec8fae0988fc4f29687bfd.tar go-tangerine-aa34cc1069a815ed66ec8fae0988fc4f29687bfd.tar.gz go-tangerine-aa34cc1069a815ed66ec8fae0988fc4f29687bfd.tar.bz2 go-tangerine-aa34cc1069a815ed66ec8fae0988fc4f29687bfd.tar.lz go-tangerine-aa34cc1069a815ed66ec8fae0988fc4f29687bfd.tar.xz go-tangerine-aa34cc1069a815ed66ec8fae0988fc4f29687bfd.tar.zst go-tangerine-aa34cc1069a815ed66ec8fae0988fc4f29687bfd.zip |
vendor: sync to latest core and fix conflict
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/total-ordering.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/total-ordering.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/total-ordering.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/total-ordering.go index 52f927005..3bf6946ae 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/total-ordering.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/total-ordering.go @@ -535,11 +535,13 @@ type totalOrderingGlobalVector struct { cachedCandidateInfo *totalOrderingCandidateInfo } -func newTotalOrderingGlobalVector(numChains uint32) *totalOrderingGlobalVector { +func newTotalOrderingGlobalVector( + initRound uint64, numChains uint32) *totalOrderingGlobalVector { return &totalOrderingGlobalVector{ blocks: make([][]*types.Block, numChains), tips: make([]*types.Block, numChains), breakpoints: make([][]*totalOrderingBreakpoint, numChains), + curRound: initRound, } } @@ -792,14 +794,14 @@ type totalOrdering struct { } // newTotalOrdering constructs an totalOrdering instance. -func newTotalOrdering(dMoment time.Time, round uint64, cfg *types.Config) *totalOrdering { +func newTotalOrdering( + dMoment time.Time, round uint64, cfg *types.Config) *totalOrdering { config := &totalOrderingConfig{} config.fromConfig(round, cfg) config.setRoundBeginTime(dMoment) candidates := make([]*totalOrderingCandidateInfo, config.numChains) to := &totalOrdering{ pendings: make(map[common.Hash]*types.Block), - globalVector: newTotalOrderingGlobalVector(config.numChains), dirtyChainIDs: make([]int, 0, config.numChains), acked: make(map[common.Hash]map[common.Hash]struct{}), objCache: newTotalOrderingObjectCache(config.numChains), @@ -807,6 +809,8 @@ func newTotalOrdering(dMoment time.Time, round uint64, cfg *types.Config) *total candidates: candidates, candidateChainIDs: make([]uint32, 0, config.numChains), curRound: config.roundID, + globalVector: newTotalOrderingGlobalVector( + config.roundID, config.numChains), } to.configs = []*totalOrderingConfig{config} return to @@ -898,7 +902,8 @@ func (to *totalOrdering) clean(b *types.Block) { } // updateVectors is a helper function to update all cached vectors. -func (to *totalOrdering) updateVectors(b *types.Block) (isOldest bool, err error) { +func (to *totalOrdering) updateVectors( + b *types.Block) (isOldest bool, err error) { var ( candidateHash common.Hash chainID uint32 |