Changes:
- added mapWalletInputs to track wallet tx’s that use a certain outpoint
- added AddWalletTx to update mapWallet and keep mapWalletInputs up-to-date
- CWalletTx’s can be in a rejected state and optionally “conflicting”, in which case they are ignored for balances and coin selection.
- rejected tx’s are stored separately in wallet.dat (as ‘rejtx’ key, and with an additional ‘rejected’ field)
- new function MarkConflicting() marks a tx conflicting, and all dependent wallet transactions rejected.
- a new function SyncWithWallet will do both adding to the block chain and check for conflicts, and is called when connecting blocks, for incoming transactions, and when rescanning
- WalletUpdateSpend works now per-transaction, and is not called anymore from script, but from AddToWallet and SyncWithWallet
- GUI is updated to show rejected transactions as “rejected” instead of “0/unconfirmed”, with credit and debet 0 (like unmatured generations)
Re-enabling of transactions after they would stop being conflicting after a block chain reorganisation is not supported yet. The is no RPC call to retrieve information about rejected transactions.