mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-15 16:38:23 +01:00
node: use uint256::FromUserHex for -assumevalid parsing
Removes dependency on unsafe and deprecated uint256S. This makes parsing more strict, by returning an error when the input contains non-hex characters, or when it contains more than 64 hex digits. Also make feature_assumevalid.py more robust by using CBlock.hash which is guaranteed to be 64 characters long, as opposed to the variable-length hex(CBlock.sha256)
This commit is contained in:
@@ -139,8 +139,8 @@ class AssumeValidTest(BitcoinTestFramework):
|
||||
height += 1
|
||||
|
||||
# Start node1 and node2 with assumevalid so they accept a block with a bad signature.
|
||||
self.start_node(1, extra_args=["-assumevalid=" + hex(block102.sha256)])
|
||||
self.start_node(2, extra_args=["-assumevalid=" + hex(block102.sha256)])
|
||||
self.start_node(1, extra_args=["-assumevalid=" + block102.hash])
|
||||
self.start_node(2, extra_args=["-assumevalid=" + block102.hash])
|
||||
|
||||
p2p0 = self.nodes[0].add_p2p_connection(BaseNode())
|
||||
p2p0.send_header_for_blocks(self.blocks[0:2000])
|
||||
|
||||
Reference in New Issue
Block a user