diff options
-rw-r--r-- | src/rpc/mempool.cpp | 4 | ||||
-rwxr-xr-x | test/functional/rpc_packages.py | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/rpc/mempool.cpp b/src/rpc/mempool.cpp index a3452c7886..9fa3c32a8f 100644 --- a/src/rpc/mempool.cpp +++ b/src/rpc/mempool.cpp @@ -861,9 +861,9 @@ static RPCHelpMan submitpackage() [&](const RPCHelpMan& self, const JSONRPCRequest& request) -> UniValue { const UniValue raw_transactions = request.params[0].get_array(); - if (raw_transactions.size() < 1 || raw_transactions.size() > MAX_PACKAGE_COUNT) { + if (raw_transactions.size() < 2 || raw_transactions.size() > MAX_PACKAGE_COUNT) { throw JSONRPCError(RPC_INVALID_PARAMETER, - "Array must contain between 1 and " + ToString(MAX_PACKAGE_COUNT) + " transactions."); + "Array must contain between 2 and " + ToString(MAX_PACKAGE_COUNT) + " transactions."); } std::vector<CTransactionRef> txns; diff --git a/test/functional/rpc_packages.py b/test/functional/rpc_packages.py index 76a08171b5..ab679eec9a 100755 --- a/test/functional/rpc_packages.py +++ b/test/functional/rpc_packages.py @@ -343,10 +343,10 @@ 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 1 and {MAX_PACKAGE_COUNT} transactions.", node.submitpackage, []) - assert_raises_rpc_error(-25, "package topology disallowed", node.submitpackage, [chain_hex[0]] * 1) + 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.", + -8, f"Array must contain between 2 and {MAX_PACKAGE_COUNT} transactions.", node.submitpackage, [chain_hex[0]] * (MAX_PACKAGE_COUNT + 1) ) |