dcrwallet
dcrwallet copied to clipboard
[ticketbuyer] lock vsp fee inputs before ticketbuyer logic runs
preserving privacy by using vspd has some caveats when it comes to buying tickets. even if your ticket purchase account balance suggests you have sufficient funds to buy N tickets, you must also send a vsp fee tx with each ticket purchase, and this may lead to your available funds only allowing for purchase of N-1 tickets.
per prior discussion with @jrick, the utxos used as inputs to the fee txs need to be chosen and locked before running the usual ticketbuyer logic. the condition where floor( balance / sdiff ) = N and floor( (balance - utxos for fees) / sdiff ) = N-1 needs to be handled.