aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_invalid_tx.py
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2020-06-27 13:13:51 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-09-03 07:53:41 +0300
commit5c049780c8b310428cf72fb304bf0c1071742785 (patch)
treec6c3331142c491bcf6559ab98ca46483d4374987 /test/functional/p2p_invalid_tx.py
parentdd097c42df7378c9d0114c04c82b3c38c18e13dc (diff)
downloadbitcoin-5c049780c8b310428cf72fb304bf0c1071742785.tar.xz
test: Add test for erase orphan tx from peer
Diffstat (limited to 'test/functional/p2p_invalid_tx.py')
-rwxr-xr-xtest/functional/p2p_invalid_tx.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/functional/p2p_invalid_tx.py b/test/functional/p2p_invalid_tx.py
index 8fef2d173f..037a4249cc 100755
--- a/test/functional/p2p_invalid_tx.py
+++ b/test/functional/p2p_invalid_tx.py
@@ -60,7 +60,6 @@ class InvalidTxRequestTest(BitcoinTestFramework):
block.solve()
# Save the coinbase for later
block1 = block
- tip = block.sha256
node.p2ps[0].send_blocks_and_test([block], node, success=True)
self.log.info("Mature the block.")
@@ -157,6 +156,7 @@ class InvalidTxRequestTest(BitcoinTestFramework):
with node.assert_debug_log(['orphanage overflow, removed 1 tx']):
node.p2ps[0].send_txs_and_test(orphan_tx_pool, node, success=False)
+ self.log.info('Test orphan with rejected parents')
rejected_parent = CTransaction()
rejected_parent.vin.append(CTxIn(outpoint=COutPoint(tx_orphan_2_invalid.sha256, 0)))
rejected_parent.vout.append(CTxOut(nValue=11 * COIN, scriptPubKey=SCRIPT_PUB_KEY_OP_TRUE))
@@ -164,6 +164,10 @@ class InvalidTxRequestTest(BitcoinTestFramework):
with node.assert_debug_log(['not keeping orphan with rejected parents {}'.format(rejected_parent.hash)]):
node.p2ps[0].send_txs_and_test([rejected_parent], node, success=False)
+ self.log.info('Test that a peer disconnection causes erase its transactions from the orphan pool')
+ with node.assert_debug_log(['Erased 100 orphan tx from peer=25']):
+ self.reconnect_p2p(num_connections=1)
+
if __name__ == '__main__':
InvalidTxRequestTest().main()