| 114 | } |
| 115 | |
| 116 | bool ScriptIsChange(const CWallet& wallet, const CScript& script) |
| 117 | { |
| 118 | // TODO: fix handling of 'change' outputs. The assumption is that any |
| 119 | // payment to a script that is ours, but is not in the address book |
| 120 | // is change. That assumption is likely to break when we implement multisignature |
| 121 | // wallets that return change back into a multi-signature-protected address; |
| 122 | // a better way of identifying which outputs are 'the send' and which are |
| 123 | // 'the change' will need to be implemented (maybe extend CWalletTx to remember |
| 124 | // which output, if any, was change). |
| 125 | AssertLockHeld(wallet.cs_wallet); |
| 126 | if (wallet.IsMine(script)) |
| 127 | { |
| 128 | CTxDestination address; |
| 129 | if (!ExtractDestination(script, address)) |
| 130 | return true; |
| 131 | if (!wallet.FindAddressBookEntry(address)) { |
| 132 | return true; |
| 133 | } |
| 134 | } |
| 135 | return false; |
| 136 | } |
| 137 | |
| 138 | CAmountMap TxGetChange(const CWallet& wallet, const CWalletTx& wtx) |
| 139 | { |
no test coverage detected