File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -1722,9 +1722,6 @@ static RPCHelpMan getchaintxstats()
1722
1722
1723
1723
const CBlockIndex& past_block{*CHECK_NONFATAL (pindex->GetAncestor (pindex->nHeight - blockcount))};
1724
1724
const int64_t nTimeDiff{pindex->GetMedianTimePast () - past_block.GetMedianTimePast ()};
1725
- const auto window_tx_count{
1726
- (pindex->nChainTx != 0 && past_block.nChainTx != 0 ) ? std::optional{pindex->nChainTx - past_block.nChainTx } : std::nullopt,
1727
- };
1728
1725
1729
1726
UniValue ret (UniValue::VOBJ);
1730
1727
ret.pushKV (" time" , (int64_t )pindex->nTime );
@@ -1736,10 +1733,11 @@ static RPCHelpMan getchaintxstats()
1736
1733
ret.pushKV (" window_block_count" , blockcount);
1737
1734
if (blockcount > 0 ) {
1738
1735
ret.pushKV (" window_interval" , nTimeDiff);
1739
- if (window_tx_count) {
1740
- ret.pushKV (" window_tx_count" , *window_tx_count);
1736
+ if (pindex->nChainTx != 0 && past_block.nChainTx != 0 ) {
1737
+ const auto window_tx_count = pindex->nChainTx - past_block.nChainTx ;
1738
+ ret.pushKV (" window_tx_count" , window_tx_count);
1741
1739
if (nTimeDiff > 0 ) {
1742
- ret.pushKV (" txrate" , double (* window_tx_count) / nTimeDiff);
1740
+ ret.pushKV (" txrate" , double (window_tx_count) / nTimeDiff);
1743
1741
}
1744
1742
}
1745
1743
}
You can’t perform that action at this time.
0 commit comments