diff options
Diffstat (limited to 'vendor/github.com/dexon-foundation/dexon-consensus/core/consensus-timestamp.go')
-rw-r--r-- | vendor/github.com/dexon-foundation/dexon-consensus/core/consensus-timestamp.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus-timestamp.go b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus-timestamp.go index a1ace97f2..d7ce8e23e 100644 --- a/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus-timestamp.go +++ b/vendor/github.com/dexon-foundation/dexon-consensus/core/consensus-timestamp.go @@ -80,6 +80,15 @@ func (ct *consensusTimestamp) appendConfig( if round != uint64(len(ct.numChainsOfRounds))+ct.numChainsBase { return ErrRoundNotIncreasing } + // This segment is to handle the corner case for config checking logic in + // processBlock method. + if len(ct.numChainsOfRounds) == 1 { + if ct.numChainsOfRounds[0] > config.NumChains { + ct.resizeTimetamps(ct.numChainsOfRounds[0]) + } else { + ct.resizeTimetamps(config.NumChains) + } + } ct.numChainsOfRounds = append(ct.numChainsOfRounds, config.NumChains) return nil } |