Changeset View
Changeset View
Standalone View
Standalone View
src/rest.cpp
Show First 20 Lines • Show All 622 Lines • ▼ Show 20 Lines | switch (rf) { | ||||
return true; | return true; | ||||
} | } | ||||
case RF_JSON: { | case RF_JSON: { | ||||
UniValue objGetUTXOResponse(UniValue::VOBJ); | UniValue objGetUTXOResponse(UniValue::VOBJ); | ||||
// pack in some essentials | // pack in some essentials | ||||
// use more or less the same output as mentioned in Bip64 | // use more or less the same output as mentioned in Bip64 | ||||
objGetUTXOResponse.push_back( | objGetUTXOResponse.pushKV("chainHeight", chainActive.Height()); | ||||
Pair("chainHeight", chainActive.Height())); | objGetUTXOResponse.pushKV( | ||||
objGetUTXOResponse.push_back(Pair( | "chaintipHash", chainActive.Tip()->GetBlockHash().GetHex()); | ||||
"chaintipHash", chainActive.Tip()->GetBlockHash().GetHex())); | objGetUTXOResponse.pushKV("bitmap", bitmapStringRepresentation); | ||||
objGetUTXOResponse.push_back( | |||||
Pair("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", ValueFromAmount(coin.out.nValue)); | ||||
// include the script in a json output | // include the script in a json output | ||||
▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines |