aboutsummaryrefslogtreecommitdiff
path: root/src/rest.cpp
diff options
context:
space:
mode:
authorKarel Bilek <kb@karelbilek.com>2017-09-22 20:04:07 +0200
committerMarcoFalke <falke.marco@gmail.com>2018-02-10 10:05:07 -0500
commit91986ed206fa830e5985560c6895b0d30b375054 (patch)
tree4422cee35e5ae916fd72d6dc5bff510e17e5814d /src/rest.cpp
parentfa1388edb17fc9eca097d93542f8d5db5aa0cf17 (diff)
scripted-diff: Use UniValue.pushKV instead of push_back(Pair())
-BEGIN VERIFY SCRIPT- git grep -l "push_back(Pair" | xargs sed -i "s/push_back(Pair(\(.*\)));/pushKV(\1);/g" -END VERIFY SCRIPT-
Diffstat (limited to 'src/rest.cpp')
-rw-r--r--src/rest.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/rest.cpp b/src/rest.cpp
index 30e481171f..eeeb3f5141 100644
--- a/src/rest.cpp
+++ b/src/rest.cpp
@@ -540,23 +540,23 @@ static bool rest_getutxos(HTTPRequest* req, const std::string& strURIPart)
// pack in some essentials
// use more or less the same output as mentioned in Bip64
- objGetUTXOResponse.push_back(Pair("chainHeight", chainActive.Height()));
- objGetUTXOResponse.push_back(Pair("chaintipHash", chainActive.Tip()->GetBlockHash().GetHex()));
- objGetUTXOResponse.push_back(Pair("bitmap", bitmapStringRepresentation));
+ objGetUTXOResponse.pushKV("chainHeight", chainActive.Height());
+ objGetUTXOResponse.pushKV("chaintipHash", chainActive.Tip()->GetBlockHash().GetHex());
+ objGetUTXOResponse.pushKV("bitmap", bitmapStringRepresentation);
UniValue utxos(UniValue::VARR);
for (const CCoin& coin : outs) {
UniValue utxo(UniValue::VOBJ);
- utxo.push_back(Pair("height", (int32_t)coin.nHeight));
- utxo.push_back(Pair("value", ValueFromAmount(coin.out.nValue)));
+ utxo.pushKV("height", (int32_t)coin.nHeight);
+ utxo.pushKV("value", ValueFromAmount(coin.out.nValue));
// include the script in a json output
UniValue o(UniValue::VOBJ);
ScriptPubKeyToUniv(coin.out.scriptPubKey, o, true);
- utxo.push_back(Pair("scriptPubKey", o));
+ utxo.pushKV("scriptPubKey", o);
utxos.push_back(utxo);
}
- objGetUTXOResponse.push_back(Pair("utxos", utxos));
+ objGetUTXOResponse.pushKV("utxos", utxos);
// return json string
std::string strJSON = objGetUTXOResponse.write() + "\n";