Merge pull request #467 from cffls/develop

Fix "Signer 0x... is not a part of the producer set at block xxxx"
This commit is contained in:
Jerry 2022-07-25 21:18:20 -07:00 committed by GitHub
commit 9dcc993566
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View file

@ -59,6 +59,8 @@ func loadSnapshot(config *params.BorConfig, sigcache *lru.ARCCache, db ethdb.Dat
return nil, err
}
snap.ValidatorSet.UpdateValidatorMap()
snap.config = config
snap.sigcache = sigcache

View file

@ -628,6 +628,10 @@ func (vals *ValidatorSet) updateValidators(updates []*Validator, deletes []*Vali
vals.applyUpdates(updates)
vals.applyRemovals(deletes)
vals.UpdateValidatorMap()
}
func (vals *ValidatorSet) UpdateValidatorMap() {
vals.validatorsMap = make(map[common.Address]int, len(vals.Validators))
for i, val := range vals.Validators {