diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp --- a/src/rpc/blockchain.cpp +++ b/src/rpc/blockchain.cpp @@ -2568,6 +2568,8 @@ {RPCResult::Type::NUM, "utxo_size_inc", "The increase/decrease in size for the utxo index (not " "discounting op_return and similar)"}, + {RPCResult::Type::BOOL, "finalized", + "Whether the block is finalized by Avalanche"}, }}, RPCExamples{ HelpExampleCli( @@ -2598,6 +2600,8 @@ const CBlock block = GetBlockChecked(config, pindex); const CBlockUndo blockUndo = GetUndoChecked(pindex); + const auto finalized{ + chainman.ActiveChainstate().IsBlockAvalancheFinalized(pindex)}; // Calculate everything if nothing selected (default) const bool do_all = stats.size() == 0; @@ -2739,6 +2743,7 @@ ret_all.pushKV("txs", (int64_t)block.vtx.size()); ret_all.pushKV("utxo_increase", outputs - inputs); ret_all.pushKV("utxo_size_inc", utxo_size_inc); + ret_all.pushKV("finalized", finalized); if (do_all) { return ret_all; diff --git a/test/functional/data/rpc_getblockstats.json b/test/functional/data/rpc_getblockstats.json --- a/test/functional/data/rpc_getblockstats.json +++ b/test/functional/data/rpc_getblockstats.json @@ -132,7 +132,8 @@ "totalfee": 0.0, "txs": 1, "utxo_increase": 1, - "utxo_size_inc": 75 + "utxo_size_inc": 75, + "finalized": false }, { "avgfee": 2.25, @@ -159,7 +160,8 @@ "totalfee": 2.25, "txs": 2, "utxo_increase": 2, - "utxo_size_inc": 150 + "utxo_size_inc": 150, + "finalized": false }, { "avgfee": 226.5, @@ -186,7 +188,8 @@ "totalfee": 679.5, "txs": 4, "utxo_increase": 4, - "utxo_size_inc": 300 + "utxo_size_inc": 300, + "finalized": false } ] } \ No newline at end of file