Audit votes for one Decred treasury spend at a fixed block
A treasury proposal and the onchain treasury-spend transaction have different identifiers. The vote tally RPC expects the transaction hash and a chain reference.
Pin the tally cutoff
Set TSPEND to a mined or mempool treasury spend and BLOCK to the hash up to which votes should be counted. Providing the explicit spend prevents the query from defaulting to whichever spends are currently in the mempool.
ids=$(jq -cn --arg h "$TSPEND" '[$h]')
dcrctl gettreasuryspendvotes "$BLOCK" "$ids"
Read the ballot's time bounds
Retain votestart, voteend, expiry, yesvotes and novotes with the returned block identity. A tally observed before the voting window ends is provisional. Even a favorable tally is not a treasury debit: confirm actual mining and the corresponding balance update to reconcile disbursement.