@@ -2457,6 +2457,7 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
24572457 " \" changeAddress\" (string, optional, default pool address) The bitcoin address to receive the change\n "
24582458 " \" changePosition\" (numeric, optional, default random) The index of the change output\n "
24592459 " \" includeWatching\" (boolean, optional, default false) Also select inputs which are watch only\n "
2460+ " \" lockUnspents\" (boolean, optional, default false) Lock selected unspent outputs\n "
24602461 " }\n "
24612462 " for backward compatibility: passing in a true instzead of an object will result in {\" includeWatching\" :true}\n "
24622463 " \n Result:\n "
@@ -2482,6 +2483,7 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
24822483 CTxDestination changeAddress = CNoDestination ();
24832484 int changePosition = -1 ;
24842485 bool includeWatching = false ;
2486+ bool lockUnspents = false ;
24852487
24862488 if (params.size () > 1 ) {
24872489 if (params[1 ].type () == UniValue::VBOOL) {
@@ -2493,7 +2495,7 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
24932495
24942496 UniValue options = params[1 ];
24952497
2496- RPCTypeCheckObj (options, boost::assign::map_list_of (" changeAddress" , UniValue::VSTR)(" changePosition" , UniValue::VNUM)(" includeWatching" , UniValue::VBOOL), true , true );
2498+ RPCTypeCheckObj (options, boost::assign::map_list_of (" changeAddress" , UniValue::VSTR)(" changePosition" , UniValue::VNUM)(" includeWatching" , UniValue::VBOOL)( " lockUnspents " , UniValue::VBOOL) , true , true );
24972499
24982500 if (options.exists (" changeAddress" )) {
24992501 CBitcoinAddress address (options[" changeAddress" ].get_str ());
@@ -2509,6 +2511,9 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
25092511
25102512 if (options.exists (" includeWatching" ))
25112513 includeWatching = options[" includeWatching" ].get_bool ();
2514+
2515+ if (options.exists (" lockUnspents" ))
2516+ lockUnspents = options[" lockUnspents" ].get_bool ();
25122517 }
25132518 }
25142519
@@ -2527,7 +2532,7 @@ UniValue fundrawtransaction(const UniValue& params, bool fHelp)
25272532 CAmount nFee;
25282533 string strFailReason;
25292534
2530- if (!pwalletMain->FundTransaction (tx, nFee, changePosition, strFailReason, includeWatching, changeAddress))
2535+ if (!pwalletMain->FundTransaction (tx, nFee, changePosition, strFailReason, includeWatching, lockUnspents, changeAddress))
25312536 throw JSONRPCError (RPC_INTERNAL_ERROR, strFailReason);
25322537
25332538 UniValue result (UniValue::VOBJ);
0 commit comments