diff --git a/nimbus/db/db_chain.nim b/nimbus/db/db_chain.nim index 6d4b8c477..223278a58 100644 --- a/nimbus/db/db_chain.nim +++ b/nimbus/db/db_chain.nim @@ -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: