mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-02-03 07:45:18 +00:00
fix getScore 32bit bug
This commit is contained in:
parent
3a10f99694
commit
ab0fb7fdf0
@ -83,8 +83,8 @@ proc getBlockHeader*(self: BaseChainDB; n: BlockNumber): BlockHeader =
|
||||
## Raises BlockNotFound error if the block is not in the DB.
|
||||
self.getBlockHeader(self.getBlockHash(n))
|
||||
|
||||
proc getScore*(self: BaseChainDB; blockHash: Hash256): int =
|
||||
rlp.decode(self.db.get(blockHashToScoreKey(blockHash).toOpenArray).toRange, int)
|
||||
proc getScore*(self: BaseChainDB; blockHash: Hash256): uint64 =
|
||||
rlp.decode(self.db.get(blockHashToScoreKey(blockHash).toOpenArray).toRange, uint64)
|
||||
|
||||
iterator findNewAncestors(self: BaseChainDB; header: BlockHeader): BlockHeader =
|
||||
## Returns the chain leading up from the given header until the first ancestor it has in
|
||||
@ -226,7 +226,7 @@ proc persistHeaderToDb*(self: BaseChainDB; header: BlockHeader): seq[BlockHeader
|
||||
|
||||
self.addBlockNumberToHashLookup(header)
|
||||
|
||||
var headScore: int
|
||||
var headScore: uint64
|
||||
try:
|
||||
headScore = self.getScore(self.getCanonicalHead().hash)
|
||||
except CanonicalHeadNotFound:
|
||||
|
Loading…
x
Reference in New Issue
Block a user