aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorglozow <gloriajzhao@gmail.com>2023-09-13 15:33:32 +0100
committerglozow <gloriajzhao@gmail.com>2023-09-13 16:14:17 +0100
commit7d7f7a1189432b1b6245ba25df572229870567cb (patch)
tree528f526514f2d398b15a9ecaf746014a5dd6a988 /test/functional
parentb2ec0326fd76e64a6d0d7e4745506b29f60d0be5 (diff)
[policy] check for duplicate txids in package
Duplicates of normal transactions would be found by looking for conflicting inputs, but this doesn't catch identical empty transactions. These wouldn't be valid but exiting early is good and AcceptPackage's result sanity checks assume non-duplicate transactions.
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/rpc_packages.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/rpc_packages.py b/test/functional/rpc_packages.py
index ae1a498e28..9c4960aa1e 100755
--- a/test/functional/rpc_packages.py
+++ b/test/functional/rpc_packages.py
@@ -212,8 +212,8 @@ class RPCPackagesTest(BitcoinTestFramework):
coin = self.wallet.get_utxo()
# tx1 and tx2 share the same inputs
- tx1 = self.wallet.create_self_transfer(utxo_to_spend=coin)
- tx2 = self.wallet.create_self_transfer(utxo_to_spend=coin)
+ tx1 = self.wallet.create_self_transfer(utxo_to_spend=coin, fee_rate=DEFAULT_FEE)
+ tx2 = self.wallet.create_self_transfer(utxo_to_spend=coin, fee_rate=2*DEFAULT_FEE)
# Ensure tx1 and tx2 are valid by themselves
assert node.testmempoolaccept([tx1["hex"]])[0]["allowed"]
@@ -222,8 +222,8 @@ class RPCPackagesTest(BitcoinTestFramework):
self.log.info("Test duplicate transactions in the same package")
testres = node.testmempoolaccept([tx1["hex"], tx1["hex"]])
assert_equal(testres, [
- {"txid": tx1["txid"], "wtxid": tx1["wtxid"], "package-error": "conflict-in-package"},
- {"txid": tx1["txid"], "wtxid": tx1["wtxid"], "package-error": "conflict-in-package"}
+ {"txid": tx1["txid"], "wtxid": tx1["wtxid"], "package-error": "package-contains-duplicates"},
+ {"txid": tx1["txid"], "wtxid": tx1["wtxid"], "package-error": "package-contains-duplicates"}
])
self.log.info("Test conflicting transactions in the same package")