mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-11 21:22:47 +01:00
Harden against mistakes handling invalid blocks
Fixes a bug in AcceptBlock() in invoking CheckBlock() with incorrect arguments, and restores a call to CheckBlock() from ProcessNewBlock() as belt-and-suspenders. Updates the (overspecified) tests to match behavior.
This commit is contained in:
@@ -398,7 +398,7 @@ class FullBlockTest(ComparisonTestFramework):
|
||||
|
||||
# Extend the b26 chain to make sure bitcoind isn't accepting b26
|
||||
b27 = block(27, spend=out[7])
|
||||
yield rejected(RejectResult(16, b'bad-prevblk'))
|
||||
yield rejected(RejectResult(0, b'bad-prevblk'))
|
||||
|
||||
# Now try a too-large-coinbase script
|
||||
tip(15)
|
||||
@@ -410,7 +410,7 @@ class FullBlockTest(ComparisonTestFramework):
|
||||
|
||||
# Extend the b28 chain to make sure bitcoind isn't accepting b28
|
||||
b29 = block(29, spend=out[7])
|
||||
yield rejected(RejectResult(16, b'bad-prevblk'))
|
||||
yield rejected(RejectResult(0, b'bad-prevblk'))
|
||||
|
||||
# b30 has a max-sized coinbase scriptSig.
|
||||
tip(23)
|
||||
|
||||
Reference in New Issue
Block a user