Created a new wallet and walletTx function IsAllFromMe
which correctly computes whether all the inputs to a transaction match the requested IsMine filter.
Original first commit https://github.com/bitcoin/bitcoin/pull/8456/commits/766e8a40b478353a89622f42809ddb11e695a0c9 already merged.
- Commits 1 and 6 add the new function and remove the old walletTx
IsFromMe
. - Commit 2 update IsTrusted to use the new function. No change in behavior as long as vin.size() > 0. Open question as to whether this should be changed to use ISMINE_ALL?
- Commit 4 remove code that was already redundant because of call to IsTrusted
- Commit 3 make a small change to
SelectCoinsMinConf
to only consider new outputs spendable quickly if all the inputs were ours, not just at least one. - Commit 5 changes the output in
gettransaction
for mixed debit transactions where some inputs were ours and some weren’t. It’ll report the correct fee if possible, otherwise 0. Note that the fee reported in the details and any other function which depends onListTransactions
is not changed asgetbalance("*")
depends on having incorrect negative fees calculated on mixed debit transactions in order to track the right balances.
Note that there are other places in the code such as AddToWalletIfInvolvingMe
which ideally would be updated to distinguish between 0 satoshi prevouts that are “MINE” and prevouts that aren’t “MINE”.