@@ -2199,17 +2199,21 @@ UniValue scantxoutset(const JSONRPCRequest& request)
2199
2199
},
2200
2200
RPCResult{
2201
2201
" {\n "
2202
+ " \" success\" : true|false, (boolean) Whether the scan was completed\n "
2203
+ " \" txouts\" : n, (numeric) The number of unspent transaction outputs scanned\n "
2204
+ " \" height\" : n, (numeric) The current block height (index)\n "
2205
+ " \" bestblock\" : \" hex\" , (string) The hash of the block at the tip of the chain\n "
2202
2206
" \" unspents\" : [\n "
2203
- " {\n "
2204
- " \" txid\" : \" transactionid \" , (string) The transaction id\n "
2205
- " \" vout\" : n, (numeric) the vout value\n "
2206
- " \" scriptPubKey\" : \" script\" , (string) the script key\n "
2207
- " \" desc\" : \" descriptor\" , (string) A specialized descriptor for the matched scriptPubKey\n "
2208
- " \" amount\" : x.xxx, (numeric) The total amount in " + CURRENCY_UNIT + " of the unspent output\n "
2209
- " \" height\" : n, (numeric) Height of the unspent transaction output\n "
2207
+ " {\n "
2208
+ " \" txid\" : \" hash \" , (string) The transaction id\n "
2209
+ " \" vout\" : n, (numeric) The vout value\n "
2210
+ " \" scriptPubKey\" : \" script\" , (string) The script key\n "
2211
+ " \" desc\" : \" descriptor\" , (string) A specialized descriptor for the matched scriptPubKey\n "
2212
+ " \" amount\" : x.xxx, (numeric) The total amount in " + CURRENCY_UNIT + " of the unspent output\n "
2213
+ " \" height\" : n, (numeric) Height of the unspent transaction output\n "
2210
2214
" }\n "
2211
- " ,...], \n "
2212
- " \" total_amount\" : x.xxx, (numeric) The total amount of all found unspent outputs in " + CURRENCY_UNIT + " \n "
2215
+ " ,...],\n "
2216
+ " \" total_amount\" : x.xxx, (numeric) The total amount of all found unspent outputs in " + CURRENCY_UNIT + " \n "
2213
2217
" ]\n "
2214
2218
},
2215
2219
RPCExamples{" " },
@@ -2293,15 +2297,20 @@ UniValue scantxoutset(const JSONRPCRequest& request)
2293
2297
g_scan_progress = 0 ;
2294
2298
int64_t count = 0 ;
2295
2299
std::unique_ptr<CCoinsViewCursor> pcursor;
2300
+ CBlockIndex* tip;
2296
2301
{
2297
2302
LOCK (cs_main);
2298
2303
::ChainstateActive ().ForceFlushStateToDisk();
2299
2304
pcursor = std::unique_ptr<CCoinsViewCursor>(pcoinsdbview->Cursor ());
2300
2305
assert (pcursor);
2306
+ tip = ::ChainActive ().Tip ();
2307
+ assert (tip);
2301
2308
}
2302
2309
bool res = FindScriptPubKey (g_scan_progress, g_should_abort_scan, count, pcursor.get (), needles, coins);
2303
2310
result.pushKV (" success" , res);
2304
- result.pushKV (" searched_items" , count);
2311
+ result.pushKV (" txouts" , count);
2312
+ result.pushKV (" height" , tip->nHeight );
2313
+ result.pushKV (" bestblock" , tip->GetBlockHash ().GetHex ());
2305
2314
2306
2315
for (const auto & it : coins) {
2307
2316
const COutPoint& outpoint = it.first ;
0 commit comments