mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-19 14:53:43 +01:00
113a422822wallet: Add m_cached_from_me to cache "from me" status (Ava Chow)609d265ebctest: Add a test for anchor outputs in the wallet (Ava Chow)c40dc822d7wallet: Throw an error in sendall if the tx size cannot be calculated (Ava Chow)39a7dbdd27wallet: Determine IsFromMe by checking for TXOs of inputs (Ava Chow)e76c2f7a41test: Test wallet 'from me' status change (Ava Chow) Pull request description: One of the ways that the wallet would determine if a transaction was sent from the wallet was by checking if the total amount being spent by a transaction from outputs known to the wallet was greater than 0. This has worked fine until recently since there was no reason for 0-value outputs to be created. However, with ephemeral dust and P2A, it is possible to create standard 0-value outputs, and the wallet was not correctly identifying the spends of such outputs. This PR updates `IsFromMe` to only check whether the wallet knows any of the inputs, rather than checking the debit amount of a transaction. Additionally, a new functional test is added to test for this case, as well as a few other anchor output related scenarios. This also revealed a bug in `sendall` which would cause an assertion error when trying to spend all of the outputs in a wallet that has anchor outputs. Fixes #33265 ACKs for top commit: rkrux: lgtm ACK113a422822enirox001: Tested ACK113a422. Ran the full functional test suite including `wallet_anchor.py`; all tests passed. Fix for 0 value anchor detection and sendall size errors looks good. LGTM. furszy: ACK113a422822Tree-SHA512: df2ce4b258d1875ad0b4f27a5b9b4437137a5889a7d5ed7fbca65f904615e9572d232a8b8d070760f75ac168c1a49b7981f6b5052308575866dc610d191ca964