Skip to content

Commit bced8ea

Browse files
author
MarcoFalke
committed
Merge #13927: rpc: Use pushKV in some new PSBT RPCs
227d27e Use pushKV in some new PSBT RPCs. (Daniel Kraft) Pull request description: Most of the code uses `UniValue::pushKV` where appropriate, but some new RPC code related to PSBTs did not. This fixes those places - after this change, there are no remaining source files I could find that contain `push_back(Pair(`. Tree-SHA512: d6567cf144d05d7e42276bd66ff4cd44413328f985772d11bb9d7339d32ab7c3438d4bb0040a37e75f8d193c610b08fa971073935885e0a178546aa045daf9fa
2 parents 09ada21 + 227d27e commit bced8ea

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/rpc/rawtransaction.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1662,12 +1662,12 @@ UniValue finalizepsbt(const JSONRPCRequest& request)
16621662
mtx.vin[i].scriptWitness = psbtx.inputs[i].final_script_witness;
16631663
}
16641664
ssTx << mtx;
1665-
result.push_back(Pair("hex", HexStr(ssTx.begin(), ssTx.end())));
1665+
result.pushKV("hex", HexStr(ssTx.begin(), ssTx.end()));
16661666
} else {
16671667
ssTx << psbtx;
1668-
result.push_back(Pair("psbt", EncodeBase64((unsigned char*)ssTx.data(), ssTx.size())));
1668+
result.pushKV("psbt", EncodeBase64((unsigned char*)ssTx.data(), ssTx.size()));
16691669
}
1670-
result.push_back(Pair("complete", complete));
1670+
result.pushKV("complete", complete);
16711671

16721672
return result;
16731673
}

src/wallet/rpcwallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4630,8 +4630,8 @@ UniValue walletprocesspsbt(const JSONRPCRequest& request)
46304630
UniValue result(UniValue::VOBJ);
46314631
CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION);
46324632
ssTx << psbtx;
4633-
result.push_back(Pair("psbt", EncodeBase64((unsigned char*)ssTx.data(), ssTx.size())));
4634-
result.push_back(Pair("complete", complete));
4633+
result.pushKV("psbt", EncodeBase64((unsigned char*)ssTx.data(), ssTx.size()));
4634+
result.pushKV("complete", complete);
46354635

46364636
return result;
46374637
}

0 commit comments

Comments
 (0)