[bisq-network/bitcoinj] Wallet: clone transaction before committing (#38)

sqrrm notifications at github.com
Wed Sep 22 15:11:59 CEST 2021


Problem: A transaction received from the network is added to all wallets
that find it relevant. If two wallets find the same transaction relevant
the same Transaction instance is added to both wallets.

Spending the outputs from this transaction can cause consistiency
issues, in particular if the outputs are spent in the same transaction,
as shown in WalletTest.oneTxTwoWallets. There are probably more issues
with having the same Transaction instance handled by two different
wallets.

Fix: Clone the transaction before adding it to the wallet.
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bitcoinj/pull/38

-- Commit Summary --

  * <a href="https://github.com/bisq-network/bitcoinj/pull/38/commits/d6e6f397738bc0f9f489640175067439120a9cf9">Wallet: clone transaction before committing</a>

-- File Changes --

    M core/src/main/java/org/bitcoinj/wallet/Wallet.java (18)
    M core/src/test/java/org/bitcoinj/wallet/WalletTest.java (68)

-- Patch Links --

https://github.com/bisq-network/bitcoinj/pull/38.patch
https://github.com/bisq-network/bitcoinj/pull/38.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bitcoinj/pull/38
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20210922/87f5adb6/attachment-0001.htm>


More information about the bisq-github mailing list