mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 20:12:57 +01:00
merge bitcoin#14700: Avoid race in p2p_invalid_block by waiting for the block request
This commit is contained in:
parent
a472a85ab6
commit
d9f8518d1a
@ -863,7 +863,7 @@ class FullBlockTest(BitcoinTestFramework):
|
||||
tx.vin.append(CTxIn(COutPoint(b64a.vtx[1].sha256, 0)))
|
||||
b64a = self.update_block("64a", [tx])
|
||||
assert_equal(len(b64a.serialize()), MAX_BLOCK_SIZE + 8)
|
||||
self.send_blocks([b64a], success=False, reject_reason='non-canonical ReadCompactSize():')
|
||||
self.send_blocks([b64a], success=False, reject_reason='non-canonical ReadCompactSize()')
|
||||
|
||||
# dashd doesn't disconnect us for sending a bloated block, but if we subsequently
|
||||
# resend the header message, it won't send us the getdata message again. Just
|
||||
|
@ -81,7 +81,7 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
|
||||
assert_equal(orig_hash, block2.rehash())
|
||||
assert block2_orig.vtx != block2.vtx
|
||||
|
||||
node.p2p.send_blocks_and_test([block2], node, success=False, request_block=False, reject_reason='bad-txns-duplicate')
|
||||
node.p2p.send_blocks_and_test([block2], node, success=False, reject_reason='bad-txns-duplicate')
|
||||
# Check transactions for duplicate inputs (CVE-2018-17144)
|
||||
self.log.info("Test duplicate input block.")
|
||||
|
||||
@ -104,7 +104,8 @@ class InvalidBlockRequestTest(BitcoinTestFramework):
|
||||
block3.rehash()
|
||||
block3.solve()
|
||||
|
||||
node.p2p.send_blocks_and_test([block3], node, success=False, request_block=False, reject_reason='bad-cb-amount')
|
||||
node.p2p.send_blocks_and_test([block3], node, success=False, reject_reason='bad-cb-amount')
|
||||
|
||||
|
||||
# Complete testing of CVE-2012-2459 by sending the original block.
|
||||
# It should be accepted even though it has the same hash as the mutated one.
|
||||
|
Loading…
Reference in New Issue
Block a user