Procedure to generate a report on ticket status. You need access via rpc to a dcrd node and the jq tool installed.
This might take a long time to run if you have many tickets.
- Grab the list of transactions of the wallet:
$ dcrctl --wallet listtransactions "*" 999999999 > txs.txt
- Grab the individual transaction hashes for tickets from the wallet:
$ cat txs.txt | jq ".[] | select(.txtype == \"ticket\") | .txid" | uniq | tac > txids.txt
- Create an aux script called "ticketstats.sh":
#!/bin/bash
ctl='dcrctl'
TXHASH=$1
REVERSED=$(echo "$TXHASH" | fold -w2 | tac | tr -d "\n")
ISLIVE=`$ctl existsliveticket $TXHASH`
ISMISSED=`$ctl existsmissedtickets $REVERSED`
ISEXPIRED=`$ctl existsexpiredtickets $REVERSED`
echo $TXHASH $ISLIVE $ISMISSED $ISEXPIRED
- Run the script for each ticket
$ cat txids.txt | xargs -n 1 ./ticketstatus.sh
Each resulting line will look like the following:
0102030405060708091011121314151617181920212223242526272829303132 false 00 00
That's the ticket hash, whether the ticket is live, whether it's missed (and not revoked) and if it has expired (and may or may not be revoked).