Skip to content

Commit

Permalink
Use pushKV in some new PSBT RPCs.
Browse files Browse the repository at this point in the history
Most of the code uses UniValue::pushKV where appropriate, but some new
RPC code related to PSBTs did not.
  • Loading branch information
domob1812 committed Aug 9, 2018
1 parent 3e3a50a commit 227d27e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/rpc/rawtransaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1662,12 +1662,12 @@ UniValue finalizepsbt(const JSONRPCRequest& request)
mtx.vin[i].scriptWitness = psbtx.inputs[i].final_script_witness;
}
ssTx << mtx;
result.push_back(Pair("hex", HexStr(ssTx.begin(), ssTx.end())));
result.pushKV("hex", HexStr(ssTx.begin(), ssTx.end()));
} else {
ssTx << psbtx;
result.push_back(Pair("psbt", EncodeBase64((unsigned char*)ssTx.data(), ssTx.size())));
result.pushKV("psbt", EncodeBase64((unsigned char*)ssTx.data(), ssTx.size()));
}
result.push_back(Pair("complete", complete));
result.pushKV("complete", complete);

return result;
}
Expand Down
4 changes: 2 additions & 2 deletions src/wallet/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4630,8 +4630,8 @@ UniValue walletprocesspsbt(const JSONRPCRequest& request)
UniValue result(UniValue::VOBJ);
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
ssTx << psbtx;
result.push_back(Pair("psbt", EncodeBase64((unsigned char*)ssTx.data(), ssTx.size())));
result.push_back(Pair("complete", complete));
result.pushKV("psbt", EncodeBase64((unsigned char*)ssTx.data(), ssTx.size()));
result.pushKV("complete", complete);

return result;
}
Expand Down

0 comments on commit 227d27e

Please sign in to comment.