GetUTXOStats is used to report hash_serialized_2 and total_amount (among other things) over the rpc interface. However, none of the logic can be tested by unit tests, as the function is static in rpc/blockchain.
This pull does two things:
- Remove
staticand exposeGetUTXOStatsvia the header file - Reset all stats to 0 at the beginning of the function. Otherwise the
total_amount(among others) would accumulate over successive calls, giving obviously incorrect results (seemingly violating BIP 42).