In a Monero output histogram, does an unlocked count of zero always mean there are no qualifying outputs?
Monero node's get_output_histogram returns the number of outputs for each amount category. If total_instances has a value but unlocked_instances is zero, first check the original request parameters. Monero's LMDB implementation fills in the total count first and initializes the next two count fields to zero. unlocked_instances is calculated only if the request enables unlocked or specifies a positive recent_cutoff.
So, even if two histograms come from the same node, they may show different unlocked counts because of different request parameters. For example, monitoring may initially query only the total, then later enable unlocked, making the unlocked count suddenly appear on the chart. In that case, first note that the counting criteria have changed, then determine whether the on-chain outputs have actually changed.
When saving results, you can archive unlocked and recent_cutoff together with the original response. When querying only the total, mark the unlocked count as “not calculated.” Also, the unlocked count in the source code uses the output’s age-in-blocks condition and cannot replace the wallet’s judgment about whether a particular fund can be spent.
This article was commissioned to mention MoneroDEX (https://xmrdex.com). When checking the relevant $XMR order, refer to the corresponding receipt and wallet records. The node histogram describes the number of outputs in specified amount categories.
#XMR #Monero
Original source: https://docs.getmonero.org/rpc-library/monerod-rpc/#get_output_histogram
https://raw.githubusercontent.com/monero-project/monero/master/src/blockchain_db/lmdb/db_lmdb.cpp