diff --git a/src/rest.cpp b/src/rest.cpp --- a/src/rest.cpp +++ b/src/rest.cpp @@ -628,12 +628,10 @@ // 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) { diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -78,20 +78,18 @@ result.pushKV("confirmations", confirmations); result.pushKV("height", blockindex->nHeight); result.pushKV("version", blockindex->nVersion); - result.push_back( - Pair("versionHex", strprintf("%08x", blockindex->nVersion))); + result.pushKV("versionHex", strprintf("%08x", blockindex->nVersion)); result.pushKV("merkleroot", blockindex->hashMerkleRoot.GetHex()); result.pushKV("time", int64_t(blockindex->nTime)); - result.push_back( - Pair("mediantime", int64_t(blockindex->GetMedianTimePast()))); + result.pushKV("mediantime", int64_t(blockindex->GetMedianTimePast())); result.pushKV("nonce", uint64_t(blockindex->nNonce)); result.pushKV("bits", strprintf("%08x", blockindex->nBits)); result.pushKV("difficulty", GetDifficulty(blockindex)); result.pushKV("chainwork", blockindex->nChainWork.GetHex()); if (blockindex->pprev) { - result.push_back(Pair("previousblockhash", - blockindex->pprev->GetBlockHash().GetHex())); + result.pushKV("previousblockhash", + blockindex->pprev->GetBlockHash().GetHex()); } CBlockIndex *pnext = chainActive.Next(blockindex); if (pnext) { @@ -110,8 +108,8 @@ confirmations = chainActive.Height() - blockindex->nHeight + 1; } result.pushKV("confirmations", confirmations); - result.push_back(Pair( - "size", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION))); + result.pushKV( + "size", (int)::GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION)); result.pushKV("height", blockindex->nHeight); result.pushKV("version", block.nVersion); result.pushKV("versionHex", strprintf("%08x", block.nVersion)); @@ -128,16 +126,15 @@ } result.pushKV("tx", txs); result.pushKV("time", block.GetBlockTime()); - result.push_back( - Pair("mediantime", int64_t(blockindex->GetMedianTimePast()))); + result.pushKV("mediantime", int64_t(blockindex->GetMedianTimePast())); result.pushKV("nonce", uint64_t(block.nNonce)); result.pushKV("bits", strprintf("%08x", block.nBits)); result.pushKV("difficulty", GetDifficulty(blockindex)); result.pushKV("chainwork", blockindex->nChainWork.GetHex()); if (blockindex->pprev) { - result.push_back(Pair("previousblockhash", - blockindex->pprev->GetBlockHash().GetHex())); + result.pushKV("previousblockhash", + blockindex->pprev->GetBlockHash().GetHex()); } CBlockIndex *pnext = chainActive.Next(blockindex); if (pnext) { @@ -407,12 +404,10 @@ info.pushKV("time", e.GetTime()); info.pushKV("height", (int)e.GetHeight()); info.pushKV("startingpriority", e.GetPriority(e.GetHeight())); - info.push_back( - Pair("currentpriority", e.GetPriority(chainActive.Height()))); + info.pushKV("currentpriority", e.GetPriority(chainActive.Height())); info.pushKV("descendantcount", e.GetCountWithDescendants()); info.pushKV("descendantsize", e.GetSizeWithDescendants()); - info.push_back( - Pair("descendantfees", e.GetModFeesWithDescendants() / SATOSHI)); + info.pushKV("descendantfees", e.GetModFeesWithDescendants() / SATOSHI); info.pushKV("ancestorcount", e.GetCountWithAncestors()); info.pushKV("ancestorsize", e.GetSizeWithAncestors()); info.pushKV("ancestorfees", e.GetModFeesWithAncestors() / SATOSHI); @@ -1040,8 +1035,7 @@ ret.pushKV("bogosize", int64_t(stats.nBogoSize)); ret.pushKV("hash_serialized", stats.hashSerialized.GetHex()); ret.pushKV("disk_size", stats.nDiskSize); - ret.push_back( - Pair("total_amount", ValueFromAmount(stats.nTotalAmount))); + ret.pushKV("total_amount", ValueFromAmount(stats.nTotalAmount)); } else { throw JSONRPCError(RPC_INTERNAL_ERROR, "Unable to read UTXO set"); } @@ -1126,8 +1120,8 @@ if (coin.GetHeight() == MEMPOOL_HEIGHT) { ret.pushKV("confirmations", 0); } else { - ret.push_back(Pair("confirmations", - int64_t(pindex->nHeight - coin.GetHeight() + 1))); + ret.pushKV("confirmations", + int64_t(pindex->nHeight - coin.GetHeight() + 1)); } ret.pushKV("value", ValueFromAmount(coin.GetTxOut().nValue)); UniValue o(UniValue::VOBJ); @@ -1201,8 +1195,7 @@ UniValue rv(UniValue::VOBJ); rv.pushKV("id", name); rv.pushKV("version", version); - rv.push_back( - Pair("reject", SoftForkMajorityDesc(version, pindex, consensusParams))); + rv.pushKV("reject", SoftForkMajorityDesc(version, pindex, consensusParams)); return rv; } @@ -1257,17 +1250,13 @@ UniValue obj(UniValue::VOBJ); obj.pushKV("chain", config.GetChainParams().NetworkIDString()); obj.pushKV("blocks", int(chainActive.Height())); - obj.push_back( - Pair("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1)); - obj.push_back( - Pair("bestblockhash", chainActive.Tip()->GetBlockHash().GetHex())); + obj.pushKV("headers", pindexBestHeader ? pindexBestHeader->nHeight : -1); + obj.pushKV("bestblockhash", chainActive.Tip()->GetBlockHash().GetHex()); obj.pushKV("difficulty", double(GetDifficulty(chainActive.Tip()))); - obj.push_back( - Pair("mediantime", int64_t(chainActive.Tip()->GetMedianTimePast()))); - obj.push_back( - Pair("verificationprogress", - GuessVerificationProgress(config.GetChainParams().TxData(), - chainActive.Tip()))); + obj.pushKV("mediantime", int64_t(chainActive.Tip()->GetMedianTimePast())); + obj.pushKV("verificationprogress", + GuessVerificationProgress(config.GetChainParams().TxData(), + chainActive.Tip())); obj.pushKV("chainwork", chainActive.Tip()->nChainWork.GetHex()); obj.pushKV("pruned", fPruneMode); @@ -1434,9 +1423,8 @@ size_t maxmempool = gArgs.GetArg("-maxmempool", DEFAULT_MAX_MEMPOOL_SIZE) * 1000000; ret.pushKV("maxmempool", (int64_t)maxmempool); - ret.push_back( - Pair("mempoolminfee", - ValueFromAmount(mempool.GetMinFee(maxmempool).GetFeePerK()))); + ret.pushKV("mempoolminfee", + ValueFromAmount(mempool.GetMinFee(maxmempool).GetFeePerK())); return ret; } diff --git a/src/rpc/mining.cpp b/src/rpc/mining.cpp --- a/src/rpc/mining.cpp +++ b/src/rpc/mining.cpp @@ -252,10 +252,9 @@ obj.pushKV("currentblocksize", uint64_t(nLastBlockSize)); obj.pushKV("currentblocktx", uint64_t(nLastBlockTx)); obj.pushKV("difficulty", double(GetDifficulty(chainActive.Tip()))); - obj.push_back( - Pair("blockprioritypercentage", - uint8_t(gArgs.GetArg("-blockprioritypercentage", - DEFAULT_BLOCK_PRIORITY_PERCENTAGE)))); + obj.pushKV("blockprioritypercentage", + uint8_t(gArgs.GetArg("-blockprioritypercentage", + DEFAULT_BLOCK_PRIORITY_PERCENTAGE))); obj.pushKV("errors", GetWarnings("statusbar")); obj.pushKV("networkhashps", getnetworkhashps(config, request)); obj.pushKV("pooledtx", uint64_t(mempool.size())); @@ -642,8 +641,7 @@ } UniValue aux(UniValue::VOBJ); - aux.push_back( - Pair("flags", HexStr(COINBASE_FLAGS.begin(), COINBASE_FLAGS.end()))); + aux.pushKV("flags", HexStr(COINBASE_FLAGS.begin(), COINBASE_FLAGS.end())); arith_uint256 hashTarget = arith_uint256().SetCompact(pblock->nBits); @@ -660,19 +658,17 @@ result.pushKV("previousblockhash", pblock->hashPrevBlock.GetHex()); result.pushKV("transactions", transactions); result.pushKV("coinbaseaux", aux); - result.push_back(Pair("coinbasevalue", - int64_t(pblock->vtx[0]->vout[0].nValue / SATOSHI))); - result.push_back(Pair("longpollid", - chainActive.Tip()->GetBlockHash().GetHex() + - i64tostr(nTransactionsUpdatedLast))); + result.pushKV("coinbasevalue", + int64_t(pblock->vtx[0]->vout[0].nValue / SATOSHI)); + result.pushKV("longpollid", + chainActive.Tip()->GetBlockHash().GetHex() + + i64tostr(nTransactionsUpdatedLast)); result.pushKV("target", hashTarget.GetHex()); - result.push_back( - Pair("mintime", int64_t(pindexPrev->GetMedianTimePast()) + 1)); + result.pushKV("mintime", int64_t(pindexPrev->GetMedianTimePast()) + 1); result.pushKV("mutable", aMutable); result.pushKV("noncerange", "00000000ffffffff"); // FIXME: Allow for mining block greater than 1M. - result.push_back( - Pair("sigoplimit", GetMaxBlockSigOpsCount(DEFAULT_MAX_BLOCK_SIZE))); + result.pushKV("sigoplimit", GetMaxBlockSigOpsCount(DEFAULT_MAX_BLOCK_SIZE)); result.pushKV("sizelimit", DEFAULT_MAX_BLOCK_SIZE); result.pushKV("curtime", pblock->GetBlockTime()); result.pushKV("bits", strprintf("%08x", pblock->nBits)); diff --git a/src/rpc/misc.cpp b/src/rpc/misc.cpp --- a/src/rpc/misc.cpp +++ b/src/rpc/misc.cpp @@ -109,16 +109,15 @@ obj.pushKV("blocks", (int)chainActive.Height()); obj.pushKV("timeoffset", GetTimeOffset()); if (g_connman) { - obj.push_back( - Pair("connections", - (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL))); + obj.pushKV("connections", + (int)g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL)); } - obj.push_back(Pair("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() - : std::string()))); + obj.pushKV("proxy", (proxy.IsValid() ? proxy.proxy.ToStringIPPort() + : std::string())); obj.pushKV("difficulty", double(GetDifficulty(chainActive.Tip()))); - obj.push_back(Pair("testnet", - config.GetChainParams().NetworkIDString() == - CBaseChainParams::TESTNET)); + obj.pushKV("testnet", + config.GetChainParams().NetworkIDString() == + CBaseChainParams::TESTNET); #ifdef ENABLE_WALLET if (pwallet) { obj.pushKV("keypoololdest", pwallet->GetOldestKeyPoolTime()); @@ -129,8 +128,8 @@ } obj.pushKV("paytxfee", ValueFromAmount(payTxFee.GetFeePerK())); #endif - obj.push_back(Pair("relayfee", - ValueFromAmount(config.GetMinFeePerKB().GetFeePerK()))); + obj.pushKV("relayfee", + ValueFromAmount(config.GetMinFeePerKB().GetFeePerK())); obj.pushKV("errors", GetWarnings("statusbar")); return obj; } @@ -167,8 +166,7 @@ int nRequired; ExtractDestinations(subscript, whichType, addresses, nRequired); obj.pushKV("script", GetTxnOutputType(whichType)); - obj.push_back( - Pair("hex", HexStr(subscript.begin(), subscript.end()))); + obj.pushKV("hex", HexStr(subscript.begin(), subscript.end())); UniValue a(UniValue::VARR); for (const CTxDestination &addr : addresses) { a.push_back(EncodeDestination(addr)); @@ -246,14 +244,13 @@ ret.pushKV("address", currentAddress); CScript scriptPubKey = GetScriptForDestination(dest); - ret.push_back(Pair("scriptPubKey", - HexStr(scriptPubKey.begin(), scriptPubKey.end()))); + ret.pushKV("scriptPubKey", + HexStr(scriptPubKey.begin(), scriptPubKey.end())); #ifdef ENABLE_WALLET isminetype mine = pwallet ? IsMine(*pwallet, dest) : ISMINE_NO; ret.pushKV("ismine", (mine & ISMINE_SPENDABLE) ? true : false); - ret.push_back( - Pair("iswatchonly", (mine & ISMINE_WATCH_ONLY) ? true : false)); + ret.pushKV("iswatchonly", (mine & ISMINE_WATCH_ONLY) ? true : false); UniValue detail = boost::apply_visitor(DescribeAddressVisitor(pwallet), dest); ret.pushKVs(detail); @@ -271,8 +268,8 @@ ret.pushKV("timestamp", it->second.nCreateTime); if (!it->second.hdKeypath.empty()) { ret.pushKV("hdkeypath", it->second.hdKeypath); - ret.push_back(Pair("hdmasterkeyid", - it->second.hdMasterKeyID.GetHex())); + ret.pushKV("hdmasterkeyid", + it->second.hdMasterKeyID.GetHex()); } } } diff --git a/src/rpc/net.cpp b/src/rpc/net.cpp --- a/src/rpc/net.cpp +++ b/src/rpc/net.cpp @@ -409,8 +409,7 @@ if (info.fConnected) { UniValue address(UniValue::VOBJ); address.pushKV("address", info.resolvedAddress.ToString()); - address.push_back( - Pair("connected", info.fInbound ? "inbound" : "outbound")); + address.pushKV("connected", info.fInbound ? "inbound" : "outbound"); addresses.push_back(address); } obj.pushKV("addresses", addresses); @@ -467,17 +466,16 @@ obj.pushKV("timemillis", GetTimeMillis()); UniValue outboundLimit(UniValue::VOBJ); - outboundLimit.push_back( - Pair("timeframe", g_connman->GetMaxOutboundTimeframe())); + outboundLimit.pushKV("timeframe", g_connman->GetMaxOutboundTimeframe()); outboundLimit.pushKV("target", g_connman->GetMaxOutboundTarget()); - outboundLimit.push_back( - Pair("target_reached", g_connman->OutboundTargetReached(false))); - outboundLimit.push_back(Pair("serve_historical_blocks", - !g_connman->OutboundTargetReached(true))); - outboundLimit.push_back( - Pair("bytes_left_in_cycle", g_connman->GetOutboundTargetBytesLeft())); - outboundLimit.push_back( - Pair("time_left_in_cycle", g_connman->GetMaxOutboundTimeLeftInCycle())); + outboundLimit.pushKV("target_reached", + g_connman->OutboundTargetReached(false)); + outboundLimit.pushKV("serve_historical_blocks", + !g_connman->OutboundTargetReached(true)); + outboundLimit.pushKV("bytes_left_in_cycle", + g_connman->GetOutboundTargetBytesLeft()); + outboundLimit.pushKV("time_left_in_cycle", + g_connman->GetMaxOutboundTimeLeftInCycle()); obj.pushKV("uploadtarget", outboundLimit); return obj; } @@ -495,11 +493,10 @@ obj.pushKV("name", GetNetworkName(network)); obj.pushKV("limited", IsLimited(network)); obj.pushKV("reachable", IsReachable(network)); - obj.push_back(Pair("proxy", - proxy.IsValid() ? proxy.proxy.ToStringIPPort() - : std::string())); - obj.push_back( - Pair("proxy_randomize_credentials", proxy.randomize_credentials)); + obj.pushKV("proxy", + proxy.IsValid() ? proxy.proxy.ToStringIPPort() + : std::string()); + obj.pushKV("proxy_randomize_credentials", proxy.randomize_credentials); networks.push_back(obj); } return networks; @@ -579,21 +576,21 @@ obj.pushKV("subversion", userAgent(config)); obj.pushKV("protocolversion", PROTOCOL_VERSION); if (g_connman) { - obj.push_back(Pair("localservices", - strprintf("%016x", g_connman->GetLocalServices()))); + obj.pushKV("localservices", + strprintf("%016x", g_connman->GetLocalServices())); } obj.pushKV("localrelay", fRelayTxes); obj.pushKV("timeoffset", GetTimeOffset()); if (g_connman) { obj.pushKV("networkactive", g_connman->GetNetworkActive()); - obj.push_back(Pair("connections", int(g_connman->GetNodeCount( - CConnman::CONNECTIONS_ALL)))); + obj.pushKV("connections", + int(g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL))); } obj.pushKV("networks", GetNetworksInfo()); - obj.push_back(Pair("relayfee", - ValueFromAmount(config.GetMinFeePerKB().GetFeePerK()))); - obj.push_back(Pair("excessutxocharge", - ValueFromAmount(config.GetExcessUTXOCharge()))); + obj.pushKV("relayfee", + ValueFromAmount(config.GetMinFeePerKB().GetFeePerK())); + obj.pushKV("excessutxocharge", + ValueFromAmount(config.GetExcessUTXOCharge())); UniValue localAddresses(UniValue::VARR); { LOCK(cs_mapLocalHost); diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -44,8 +44,7 @@ out.pushKV("asm", ScriptToAsmStr(scriptPubKey)); if (fIncludeHex) { - out.push_back( - Pair("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end()))); + out.pushKV("hex", HexStr(scriptPubKey.begin(), scriptPubKey.end())); } if (!ExtractDestinations(scriptPubKey, type, addresses, nRequired)) { @@ -68,8 +67,8 @@ const uint256 hashBlock, UniValue &entry) { entry.pushKV("txid", tx.GetId().GetHex()); entry.pushKV("hash", tx.GetHash().GetHex()); - entry.push_back(Pair( - "size", int(::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION)))); + entry.pushKV("size", + int(::GetSerializeSize(tx, SER_NETWORK, PROTOCOL_VERSION))); entry.pushKV("version", tx.nVersion); entry.pushKV("locktime", int64_t(tx.nLockTime)); @@ -78,15 +77,15 @@ const CTxIn &txin = tx.vin[i]; UniValue in(UniValue::VOBJ); if (tx.IsCoinBase()) { - in.push_back(Pair("coinbase", HexStr(txin.scriptSig.begin(), - txin.scriptSig.end()))); + in.pushKV("coinbase", + HexStr(txin.scriptSig.begin(), txin.scriptSig.end())); } else { in.pushKV("txid", txin.prevout.GetTxId().GetHex()); in.pushKV("vout", int64_t(txin.prevout.GetN())); UniValue o(UniValue::VOBJ); o.pushKV("asm", ScriptToAsmStr(txin.scriptSig, true)); - o.push_back(Pair( - "hex", HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); + o.pushKV("hex", + HexStr(txin.scriptSig.begin(), txin.scriptSig.end())); in.pushKV("scriptSig", o); } @@ -115,9 +114,8 @@ if (mi != mapBlockIndex.end() && (*mi).second) { CBlockIndex *pindex = (*mi).second; if (chainActive.Contains(pindex)) { - entry.push_back( - Pair("confirmations", - 1 + chainActive.Height() - pindex->nHeight)); + entry.pushKV("confirmations", + 1 + chainActive.Height() - pindex->nHeight); entry.pushKV("time", pindex->GetBlockTime()); entry.pushKV("blocktime", pindex->GetBlockTime()); } else { @@ -717,8 +715,8 @@ UniValue entry(UniValue::VOBJ); entry.pushKV("txid", txin.prevout.GetTxId().ToString()); entry.pushKV("vout", uint64_t(txin.prevout.GetN())); - entry.push_back(Pair("scriptSig", - HexStr(txin.scriptSig.begin(), txin.scriptSig.end()))); + entry.pushKV("scriptSig", + HexStr(txin.scriptSig.begin(), txin.scriptSig.end())); entry.pushKV("sequence", uint64_t(txin.nSequence)); entry.pushKV("error", strMessage); vErrorsRet.push_back(entry); diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -115,8 +115,7 @@ if (confirms > 0) { entry.pushKV("blockhash", wtx.hashBlock.GetHex()); entry.pushKV("blockindex", wtx.nIndex); - entry.push_back( - Pair("blocktime", mapBlockIndex[wtx.hashBlock]->GetBlockTime())); + entry.pushKV("blocktime", mapBlockIndex[wtx.hashBlock]->GetBlockTime()); } else { entry.pushKV("trusted", wtx.IsTrusted()); } @@ -1513,9 +1512,8 @@ obj.pushKV("address", EncodeDestination(address)); obj.pushKV("account", strAccount); obj.pushKV("amount", ValueFromAmount(nAmount)); - obj.push_back( - Pair("confirmations", - (nConf == std::numeric_limits::max() ? 0 : nConf))); + obj.pushKV("confirmations", + (nConf == std::numeric_limits::max() ? 0 : nConf)); if (!fByAccounts) { obj.pushKV("label", strAccount); } @@ -1542,9 +1540,8 @@ } obj.pushKV("account", (*it).first); obj.pushKV("amount", ValueFromAmount(nAmount)); - obj.push_back( - Pair("confirmations", - (nConf == std::numeric_limits::max() ? 0 : nConf))); + obj.pushKV("confirmations", + (nConf == std::numeric_limits::max() ? 0 : nConf)); ret.push_back(obj); } } @@ -1694,8 +1691,8 @@ entry.pushKV("category", "send"); entry.pushKV("amount", ValueFromAmount(-s.amount)); if (pwallet->mapAddressBook.count(s.destination)) { - entry.push_back( - Pair("label", pwallet->mapAddressBook[s.destination].name)); + entry.pushKV("label", + pwallet->mapAddressBook[s.destination].name); } entry.pushKV("vout", s.vout); entry.pushKV("fee", ValueFromAmount(-1 * nFee)); @@ -2046,8 +2043,8 @@ UniValue ret(UniValue::VOBJ); for (const std::pair &accountBalance : mapAccountBalances) { - ret.push_back( - Pair(accountBalance.first, ValueFromAmount(accountBalance.second))); + ret.pushKV(accountBalance.first, + ValueFromAmount(accountBalance.second)); } return ret; } @@ -2995,18 +2992,17 @@ obj.pushKV("walletname", pwallet->GetName()); obj.pushKV("walletversion", pwallet->GetVersion()); obj.pushKV("balance", ValueFromAmount(pwallet->GetBalance())); - obj.push_back(Pair("unconfirmed_balance", - ValueFromAmount(pwallet->GetUnconfirmedBalance()))); - obj.push_back(Pair("immature_balance", - ValueFromAmount(pwallet->GetImmatureBalance()))); + obj.pushKV("unconfirmed_balance", + ValueFromAmount(pwallet->GetUnconfirmedBalance())); + obj.pushKV("immature_balance", + ValueFromAmount(pwallet->GetImmatureBalance())); obj.pushKV("txcount", (int)pwallet->mapWallet.size()); obj.pushKV("keypoololdest", pwallet->GetOldestKeyPoolTime()); obj.pushKV("keypoolsize", (int64_t)kpExternalSize); CKeyID masterKeyID = pwallet->GetHDChain().masterKeyID; if (!masterKeyID.IsNull() && pwallet->CanSupportFeature(FEATURE_HD_SPLIT)) { - obj.push_back( - Pair("keypoolsize_hd_internal", - int64_t(pwallet->GetKeyPoolSize() - kpExternalSize))); + obj.pushKV("keypoolsize_hd_internal", + int64_t(pwallet->GetKeyPoolSize() - kpExternalSize)); } if (pwallet->IsCrypted()) { obj.pushKV("unlocked_until", pwallet->nRelockTime); @@ -3280,25 +3276,22 @@ entry.pushKV("address", EncodeDestination(address)); if (pwallet->mapAddressBook.count(address)) { - entry.push_back( - Pair("account", pwallet->mapAddressBook[address].name)); + entry.pushKV("account", pwallet->mapAddressBook[address].name); } if (scriptPubKey.IsPayToScriptHash()) { const CScriptID &hash = boost::get(address); CScript redeemScript; if (pwallet->GetCScript(hash, redeemScript)) { - entry.push_back( - Pair("redeemScript", - HexStr(redeemScript.begin(), redeemScript.end()))); + entry.pushKV("redeemScript", HexStr(redeemScript.begin(), + redeemScript.end())); } } } - entry.push_back(Pair("scriptPubKey", - HexStr(scriptPubKey.begin(), scriptPubKey.end()))); - entry.push_back( - Pair("amount", ValueFromAmount(out.tx->tx->vout[out.i].nValue))); + entry.pushKV("scriptPubKey", + HexStr(scriptPubKey.begin(), scriptPubKey.end())); + entry.pushKV("amount", ValueFromAmount(out.tx->tx->vout[out.i].nValue)); entry.pushKV("confirmations", out.nDepth); entry.pushKV("spendable", out.fSpendable); entry.pushKV("solvable", out.fSolvable);