Skip to content

Commit a16d151

Browse files
committed
RPC/Wallet: Check for negative min_conf in FundTransaction
1 parent af7c9d1 commit a16d151

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/wallet/rpc/spend.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,12 @@ void FundTransaction(CWallet& wallet, CMutableTransaction& tx, CAmount& fee_out,
611611
if (options.exists("minconf")) {
612612
throw JSONRPCError(RPC_INVALID_PARAMETER, "min_conf and minconf options should not both be set. Use minconf (min_conf is deprecated).");
613613
}
614+
614615
coinControl.m_min_depth = options["min_conf"].getInt<int>();
616+
617+
if (coinControl.m_min_depth < 0) {
618+
throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative min_conf");
619+
}
615620
}
616621

617622
if (options.exists("maxconf")) {

0 commit comments

Comments
 (0)