| 50 | } |
| 51 | |
| 52 | bool ScriptIsChange(const CWallet& wallet, const CScript& script) |
| 53 | { |
| 54 | // TODO: fix handling of 'change' outputs. The assumption is that any |
| 55 | // payment to a script that is ours, but is not in the address book |
| 56 | // is change. That assumption is likely to break when we implement multisignature |
| 57 | // wallets that return change back into a multi-signature-protected address; |
| 58 | // a better way of identifying which outputs are 'the send' and which are |
| 59 | // 'the change' will need to be implemented (maybe extend CWalletTx to remember |
| 60 | // which output, if any, was change). |
| 61 | AssertLockHeld(wallet.cs_wallet); |
| 62 | if (wallet.IsMine(script)) |
| 63 | { |
| 64 | CTxDestination address; |
| 65 | if (!ExtractDestination(script, address)) |
| 66 | return true; |
| 67 | if (!wallet.FindAddressBookEntry(address)) { |
| 68 | return true; |
| 69 | } |
| 70 | } |
| 71 | return false; |
| 72 | } |
| 73 | |
| 74 | bool OutputIsChange(const CWallet& wallet, const CTxOut& txout) |
| 75 | { |
no test coverage detected