Skip to content

Commit 8070c3f

Browse files
promagluke-jr
authored andcommitted
rpc: Add min_conf option to fundrawtransaction and walletcreatefundedpsbt [as deprecated]
Github-Pull: bitcoin#14641 Rebased-From: 965628a [partial]
1 parent bbbf89a commit 8070c3f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/wallet/rpc/spend.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -530,6 +530,7 @@ void FundTransaction(CWallet& wallet, CMutableTransaction& tx, CAmount& fee_out,
530530
{"subtract_fee_from_outputs", UniValueType(UniValue::VARR)},
531531
{"replaceable", UniValueType(UniValue::VBOOL)},
532532
{"conf_target", UniValueType(UniValue::VNUM)},
533+
{"min_conf", UniValueType(UniValue::VNUM)},
533534
{"estimate_mode", UniValueType(UniValue::VSTR)},
534535
{"minconf", UniValueType(UniValue::VNUM)},
535536
{"maxconf", UniValueType(UniValue::VNUM)},
@@ -606,6 +607,12 @@ void FundTransaction(CWallet& wallet, CMutableTransaction& tx, CAmount& fee_out,
606607
throw JSONRPCError(RPC_INVALID_PARAMETER, "Negative minconf");
607608
}
608609
}
610+
if (options.exists("min_conf")) {
611+
if (options.exists("minconf")) {
612+
throw JSONRPCError(RPC_INVALID_PARAMETER, "min_conf and minconf options should not both be set. Use minconf (min_conf is deprecated).");
613+
}
614+
coinControl.m_min_depth = options["min_conf"].getInt<int>();
615+
}
609616

610617
if (options.exists("maxconf")) {
611618
coinControl.m_max_depth = options["maxconf"].getInt<int>();

0 commit comments

Comments
 (0)