Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcwallet.cpp
Show First 20 Lines • Show All 3,032 Lines • ▼ Show 20 Lines | for (size_t idx = 0; idx < output_params.size(); idx++) { | ||||
const CWalletTx &trans = it->second; | const CWalletTx &trans = it->second; | ||||
if (outpt.GetN() >= trans.tx->vout.size()) { | if (outpt.GetN() >= trans.tx->vout.size()) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, vout index out of bounds"); | "Invalid parameter, vout index out of bounds"); | ||||
} | } | ||||
if (pwallet->IsSpent(outpt.GetTxId(), outpt.GetN())) { | if (pwallet->IsSpent(outpt)) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, expected unspent output"); | "Invalid parameter, expected unspent output"); | ||||
} | } | ||||
const bool is_locked = | const bool is_locked = pwallet->IsLockedCoin(outpt); | ||||
pwallet->IsLockedCoin(outpt.GetTxId(), outpt.GetN()); | |||||
if (fUnlock && !is_locked) { | if (fUnlock && !is_locked) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
"Invalid parameter, expected locked output"); | "Invalid parameter, expected locked output"); | ||||
} | } | ||||
if (!fUnlock && is_locked) { | if (!fUnlock && is_locked) { | ||||
throw JSONRPCError(RPC_INVALID_PARAMETER, | throw JSONRPCError(RPC_INVALID_PARAMETER, | ||||
▲ Show 20 Lines • Show All 1,245 Lines • Show Last 20 Lines |