diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 36fa33ddde..1bd49a7075 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -639,14 +639,18 @@ UniValue sendfromaddress(const JSONRPCRequest& request) // Wallet comments CWalletTx wtx; - if (!request.params[3].isNull() && !request.params[2].get_str().empty()) - wtx.mapValue["comment"] = request.params[2].get_str(); - if (!request.params[4].isNull() && !request.params[3].get_str().empty()) - wtx.mapValue["to"] = request.params[3].get_str(); + // Comment + if (!request.params[3].isNull() && !request.params[3].get_str().empty()) + wtx.mapValue["comment"] = request.params[3].get_str(); + + // Comment to + if (!request.params[4].isNull() && !request.params[4].get_str().empty()) + wtx.mapValue["to"] = request.params[4].get_str(); + bool fSubtractFeeFromAmount = false; if (!request.params[5].isNull()) { - fSubtractFeeFromAmount = request.params[4].get_bool(); + fSubtractFeeFromAmount = request.params[5].get_bool(); } if (!request.params[6].isNull()) { @@ -654,7 +658,7 @@ UniValue sendfromaddress(const JSONRPCRequest& request) } if (!request.params[7].isNull()) { - if (!FeeModeFromString(request.params[8].get_str(), coin_control.m_fee_mode)) { + if (!FeeModeFromString(request.params[7].get_str(), coin_control.m_fee_mode)) { throw JSONRPCError(RPC_INVALID_PARAMETER, "Invalid estimate_mode parameter"); } }