Changeset View
Changeset View
Standalone View
Standalone View
src/rest.cpp
Show First 20 Lines • Show All 661 Lines • ▼ Show 20 Lines | switch (rf) { | ||||
objGetUTXOResponse.pushKV( | objGetUTXOResponse.pushKV( | ||||
"chaintipHash", ::ChainActive().Tip()->GetBlockHash().GetHex()); | "chaintipHash", ::ChainActive().Tip()->GetBlockHash().GetHex()); | ||||
objGetUTXOResponse.pushKV("bitmap", bitmapStringRepresentation); | objGetUTXOResponse.pushKV("bitmap", bitmapStringRepresentation); | ||||
UniValue utxos(UniValue::VARR); | UniValue utxos(UniValue::VARR); | ||||
for (const CCoin &coin : outs) { | for (const CCoin &coin : outs) { | ||||
UniValue utxo(UniValue::VOBJ); | UniValue utxo(UniValue::VOBJ); | ||||
utxo.pushKV("height", int32_t(coin.nHeight)); | utxo.pushKV("height", int32_t(coin.nHeight)); | ||||
utxo.pushKV("value", ValueFromAmount(coin.out.nValue)); | utxo.pushKV("value", coin.out.nValue); | ||||
// include the script in a json output | // include the script in a json output | ||||
UniValue o(UniValue::VOBJ); | UniValue o(UniValue::VOBJ); | ||||
ScriptPubKeyToUniv(coin.out.scriptPubKey, o, true); | ScriptPubKeyToUniv(coin.out.scriptPubKey, o, true); | ||||
utxo.pushKV("scriptPubKey", o); | utxo.pushKV("scriptPubKey", o); | ||||
utxos.push_back(utxo); | utxos.push_back(utxo); | ||||
} | } | ||||
objGetUTXOResponse.pushKV("utxos", utxos); | objGetUTXOResponse.pushKV("utxos", utxos); | ||||
▲ Show 20 Lines • Show All 100 Lines • Show Last 20 Lines |