Changeset View
Changeset View
Standalone View
Standalone View
src/wallet/rpcdump.cpp
Show First 20 Lines • Show All 1,070 Lines • ▼ Show 20 Lines | static UniValue dumpcoins(const Config &config, const JSONRPCRequest &request) { | ||||
UniValue result(UniValue::VOBJ); | UniValue result(UniValue::VOBJ); | ||||
for (const auto &p : wallet.ListCoins()) { | for (const auto &p : wallet.ListCoins()) { | ||||
UniValue coins(UniValue::VARR); | UniValue coins(UniValue::VARR); | ||||
for (const auto &o : p.second) { | for (const auto &o : p.second) { | ||||
UniValue utxo(UniValue::VOBJ); | UniValue utxo(UniValue::VOBJ); | ||||
utxo.pushKV("txid", o.tx->GetId().ToString()); | utxo.pushKV("txid", o.tx->GetId().ToString()); | ||||
utxo.pushKV("vout", o.i); | utxo.pushKV("vout", o.i); | ||||
utxo.pushKV("depth", o.nDepth); | utxo.pushKV("depth", o.nDepth); | ||||
utxo.pushKV("value", ValueFromAmount(o.tx->tx->vout[o.i].nValue)); | utxo.pushKV("value", o.tx->tx->vout[o.i].nValue); | ||||
coins.push_back(std::move(utxo)); | coins.push_back(std::move(utxo)); | ||||
} | } | ||||
result.pushKV(EncodeDestination(p.first, config), coins); | result.pushKV(EncodeDestination(p.first, config), coins); | ||||
} | } | ||||
return result; | return result; | ||||
▲ Show 20 Lines • Show All 1,244 Lines • Show Last 20 Lines |