Look up a stake-tree Decred output with the complete outpoint
A Decred outpoint includes its transaction tree. A database inherited from a Bitcoin-style integration can lose that component and fail to retrieve a valid stake output.
Pass the stake tree explicitly
Use an unspent output from a known stake-tree transaction in STAKE_TXID. This sample queries output zero in tree one and excludes mempool effects. Replace the index with the actual output being investigated.
dcrctl gettxout "$STAKE_TXID" 0 1 false
Keep the tree in your primary key
Preserve transaction hash, index and tree when serializing the outpoint. Regular-tree outputs use tree zero. A null response can mean the output was spent, never existed, or the identifier was assembled incorrectly. Cross-check the originating transaction before treating absence as proof of spending.