diff --git a/src/bitcoin-tx.cpp b/src/bitcoin-tx.cpp --- a/src/bitcoin-tx.cpp +++ b/src/bitcoin-tx.cpp @@ -627,7 +627,7 @@ const int nOut = prevOut["vout"].get_int(); if (nOut < 0) { - throw std::runtime_error("vout must be positive"); + throw std::runtime_error("vout cannot be negative"); } COutPoint out(txid, nOut); diff --git a/src/rpc/avalanche.cpp b/src/rpc/avalanche.cpp --- a/src/rpc/avalanche.cpp +++ b/src/rpc/avalanche.cpp @@ -279,7 +279,7 @@ int nOut = find_value(stake, "vout").get_int(); if (nOut < 0) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, - "vout must be positive"); + "vout cannot be negative"); } const int height = find_value(stake, "height").get_int(); diff --git a/src/rpc/rawtransaction_util.cpp b/src/rpc/rawtransaction_util.cpp --- a/src/rpc/rawtransaction_util.cpp +++ b/src/rpc/rawtransaction_util.cpp @@ -71,7 +71,7 @@ int nOutput = vout_v.get_int(); if (nOutput < 0) { throw JSONRPCError(RPC_INVALID_PARAMETER, - "Invalid parameter, vout must be positive"); + "Invalid parameter, vout cannot be negative"); } uint32_t nSequence = @@ -202,7 +202,7 @@ int nOut = find_value(prevOut, "vout").get_int(); if (nOut < 0) { throw JSONRPCError(RPC_DESERIALIZATION_ERROR, - "vout must be positive"); + "vout cannot be negative"); } COutPoint out(txid, nOut); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -2726,7 +2726,7 @@ if (nOutput < 0) { throw JSONRPCError( RPC_INVALID_PARAMETER, - "Invalid parameter, vout must be positive"); + "Invalid parameter, vout cannot be negative"); } const TxId txid(ParseHashO(o, "txid")); diff --git a/test/functional/abc_rpc_buildavalancheproof.py b/test/functional/abc_rpc_buildavalancheproof.py --- a/test/functional/abc_rpc_buildavalancheproof.py +++ b/test/functional/abc_rpc_buildavalancheproof.py @@ -55,7 +55,7 @@ negative_vout = good_stake.copy() negative_vout['vout'] = -1 check_buildavalancheproof_error(-22, - "vout must be positive", + "vout cannot be negative", [negative_vout], ) diff --git a/test/functional/rpc_rawtransaction.py b/test/functional/rpc_rawtransaction.py --- a/test/functional/rpc_rawtransaction.py +++ b/test/functional/rpc_rawtransaction.py @@ -127,7 +127,7 @@ self.nodes[0].createrawtransaction, [{'txid': txid}], {}) assert_raises_rpc_error(-8, "Invalid parameter, vout must be a number", self.nodes[0].createrawtransaction, [{'txid': txid, 'vout': 'foo'}], {}) - assert_raises_rpc_error(-8, "Invalid parameter, vout must be positive", + assert_raises_rpc_error(-8, "Invalid parameter, vout cannot be negative", self.nodes[0].createrawtransaction, [{'txid': txid, 'vout': -1}], {}) assert_raises_rpc_error(-8, "Invalid parameter, sequence number is out of range", self.nodes[0].createrawtransaction, [{'txid': txid, 'vout': 0, 'sequence': -1}], {}) @@ -551,7 +551,7 @@ inputs[0]['vout'] = -1 assert_raises_rpc_error( - -8, 'Invalid parameter, vout must be positive', + -8, 'Invalid parameter, vout cannot be negative', self.nodes[0].createrawtransaction, inputs, outputs) inputs[0]['vout'] = 1