mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-30 02:15:54 +02:00
wallet: IsSpent, 'COutPoint' arg instead of (hash, index)
This commit is contained in:
@@ -341,7 +341,7 @@ RPCHelpMan lockunspent()
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, vout index out of bounds");
|
||||
}
|
||||
|
||||
if (pwallet->IsSpent(outpt.hash, outpt.n)) {
|
||||
if (pwallet->IsSpent(outpt)) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid parameter, expected unspent output");
|
||||
}
|
||||
|
||||
|
||||
@@ -1387,7 +1387,7 @@ RPCHelpMan sendall()
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, "Cannot combine send_max with specific inputs.");
|
||||
} else if (options.exists("inputs")) {
|
||||
for (const CTxIn& input : rawTx.vin) {
|
||||
if (pwallet->IsSpent(input.prevout.hash, input.prevout.n)) {
|
||||
if (pwallet->IsSpent(input.prevout)) {
|
||||
throw JSONRPCError(RPC_INVALID_PARAMETER, strprintf("Input not available. UTXO (%s:%d) was already spent.", input.prevout.hash.ToString(), input.prevout.n));
|
||||
}
|
||||
const CWalletTx* tx{pwallet->GetWalletTx(input.prevout.hash)};
|
||||
|
||||
Reference in New Issue
Block a user