Join GitHub today
mempool utxo set is incorrect #618
The mempool utxo set handling is wrong as it does not consider any unspent outputs in the latest block to be part of the utxo set. This causes issues with clients such as wallets that spend very new outputs that just got mined in the last block.
What's even more baffling here is not the missing outputs of the latest block, but that mempool outputs themselves are still allowed to be spent.
The reason for this bug is that there is confusion over what dcrd's block validation is for. Rather than thinking about blocks as invalid until they are confirmed, all blocks should be considered valid unless the next block in the main chain has invalidated them (I fixed this in wallet a while ago, and this is why with minconf=0 or 1 it still does choose to spend these outputs).
Thankfully this is NOT an issue for block processing, so fixing this does not involve a hard fork.