mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-08 11:44:14 +01:00
Merge bitcoin/bitcoin#31096: Package validation: accept packages of size 1
32fc59796frpc: Allow single transaction through submitpackage (glozow) Pull request description: There's no particular reason to restrict single transaction submissions with submitpackage. This change relaxes the RPC checks as enables the `AcceptPackage` flow to accept packages of a single transaction. Resolves #31085 ACKs for top commit: naumenkogs: ACK32fc59796fachow101: ACK32fc59796fglozow: ACK32fc59796fTree-SHA512: ffed353bfdca610ffcfd53b40b76da05ffc26df6bac4b0421492e067bede930380e03399d2e2d1d17f0e88fb91cd8eb376e3aabebbabcc724590bf068d09807c
This commit is contained in:
@@ -377,8 +377,8 @@ class RPCPackagesTest(BitcoinTestFramework):
|
||||
assert txid_list[0] not in node.getrawmempool()
|
||||
assert txid_list[1] not in node.getrawmempool()
|
||||
|
||||
self.log.info("Submitpackage valid packages with 1 child and some number of parents")
|
||||
for num_parents in [1, 2, 24]:
|
||||
self.log.info("Submitpackage valid packages with 1 child and some number of parents (or none)")
|
||||
for num_parents in [0, 1, 2, 24]:
|
||||
self.test_submit_child_with_parents(num_parents, False)
|
||||
self.test_submit_child_with_parents(num_parents, True)
|
||||
|
||||
@@ -389,10 +389,9 @@ class RPCPackagesTest(BitcoinTestFramework):
|
||||
assert_raises_rpc_error(-25, "package topology disallowed", node.submitpackage, chain_hex)
|
||||
assert_equal(legacy_pool, node.getrawmempool())
|
||||
|
||||
assert_raises_rpc_error(-8, f"Array must contain between 2 and {MAX_PACKAGE_COUNT} transactions.", node.submitpackage, [])
|
||||
assert_raises_rpc_error(-8, f"Array must contain between 2 and {MAX_PACKAGE_COUNT} transactions.", node.submitpackage, [chain_hex[0]] * 1)
|
||||
assert_raises_rpc_error(-8, f"Array must contain between 1 and {MAX_PACKAGE_COUNT} transactions.", node.submitpackage, [])
|
||||
assert_raises_rpc_error(
|
||||
-8, f"Array must contain between 2 and {MAX_PACKAGE_COUNT} transactions.",
|
||||
-8, f"Array must contain between 1 and {MAX_PACKAGE_COUNT} transactions.",
|
||||
node.submitpackage, [chain_hex[0]] * (MAX_PACKAGE_COUNT + 1)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user