rpc: avoid crashing on clique getSigner during sync (#23832)

This commit is contained in:
Martin Holst Swende
2021-11-01 07:51:03 +01:00
committed by GitHub
parent c113520d5d
commit ff844918e8
2 changed files with 13 additions and 0 deletions

View File

@ -186,6 +186,16 @@ func (bnh *BlockNumberOrHash) Number() (BlockNumber, bool) {
return BlockNumber(0), false
}
func (bnh *BlockNumberOrHash) String() string {
if bnh.BlockNumber != nil {
return strconv.Itoa(int(*bnh.BlockNumber))
}
if bnh.BlockHash != nil {
return bnh.BlockHash.String()
}
return "nil"
}
func (bnh *BlockNumberOrHash) Hash() (common.Hash, bool) {
if bnh.BlockHash != nil {
return *bnh.BlockHash, true