Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-segwit-recovery-activation.py
Show First 20 Lines • Show All 354 Lines • ▼ Show 20 Lines | def get_tests(self): | ||||
# Blocks containing segwit spending txns are now accepted in both | # Blocks containing segwit spending txns are now accepted in both | ||||
# nodes. | # nodes. | ||||
block(5) | block(5) | ||||
postforkblock = update_block(5, [txspend, txspend_case0]) | postforkblock = update_block(5, [txspend, txspend_case0]) | ||||
yield accepted() | yield accepted() | ||||
sync_blocks(self.nodes) | sync_blocks(self.nodes) | ||||
# Ok, now we check if a reorg work properly accross the activation. | # Ok, now we check if a reorg work properly across the activation. | ||||
node_nonstd.invalidateblock(postforkblock.hash) | node_nonstd.invalidateblock(postforkblock.hash) | ||||
check_mempool_equal(node_nonstd, [txspend, txspend_case0]) | check_mempool_equal(node_nonstd, [txspend, txspend_case0]) | ||||
# Also check that nodes checking for standardness don't return a segwit | # Also check that nodes checking for standardness don't return a segwit | ||||
# spending txn into the mempool when disconnecting a block. | # spending txn into the mempool when disconnecting a block. | ||||
node_std.invalidateblock(postforkblock.hash) | node_std.invalidateblock(postforkblock.hash) | ||||
assert(len(node_std.getrawmempool()) == 0) | assert(len(node_std.getrawmempool()) == 0) | ||||
# Deactivate the fork. The spending tx has been evicted from the | # Deactivate the fork. The spending tx has been evicted from the | ||||
# mempool | # mempool | ||||
node_nonstd.invalidateblock(forkblock.hash) | node_nonstd.invalidateblock(forkblock.hash) | ||||
assert(len(node_nonstd.getrawmempool()) == 0) | assert(len(node_nonstd.getrawmempool()) == 0) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
SegwitRecoveryActivationTest().main() | SegwitRecoveryActivationTest().main() |