[bisq-network/bisq] Allow spending of unconfirmed BSQ change outputs (#2482)

Manfred Karrer notifications at github.com
Fri Mar 1 04:23:39 UTC 2019


When creating a BSQ transaction (actually at commit time as we can create a tx and then
cancel it in the confirmation popup) we store the change output (only that not the other
possible BSQ output) in a persisted list. The BsqCoinSelector will take that list to
allow spending those coins. We use the txType to find the index of the cahnge output.
We only have one change output in the transactions created in Bisq. Multiple change
outputs would be valid but our goal is only increased usability in the Bisq app and it is
not related to validation rules.

We update out list at each new block confirmation.

With that approach we avoid too much dependencies to the BitcoinJ side.

- Add UnconfirmedBsqChangeOutputListService and persisted UnconfirmedBsqChangeOutputList
for storing unconfirmed outputs
- Add lookup for unconfirmed BSQ change outputs at BsqCoinSelector and allow spending if
found
- Pass TxType for walletsManager.publishAndCommitBsqTx calls
- Add TxType to bsqWalletService.commitTx
- Refactor getPreparedSendTx methods for BSQ and BTC sending to one common method with a
coinselector parameter.
- Add getChangeAddress method to BsqWalletService to make change outputs more explicit
- Add unconfirmedChangeBalance to onUpdateBalances handlers
- Rename availableBalance to availableConfirmedBalance in onUpdateBalances
- Unify onUpdateBalances parameter names
You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/2482

-- Commit Summary --

  * Allow spending of unconfirmed BSQ change outputs

-- File Changes --

    M common/src/main/proto/pb.proto (11)
    M core/src/main/java/bisq/core/btc/listeners/BsqBalanceListener.java (3)
    M core/src/main/java/bisq/core/btc/wallet/BsqCoinSelector.java (26)
    M core/src/main/java/bisq/core/btc/wallet/BsqWalletService.java (80)
    M core/src/main/java/bisq/core/btc/wallet/WalletService.java (9)
    M core/src/main/java/bisq/core/btc/wallet/WalletsManager.java (5)
    M core/src/main/java/bisq/core/dao/DaoModule.java (2)
    M core/src/main/java/bisq/core/dao/governance/asset/AssetService.java (3)
    M core/src/main/java/bisq/core/dao/governance/blindvote/MyBlindVoteListService.java (3)
    M core/src/main/java/bisq/core/dao/governance/bond/lockup/LockupTxService.java (3)
    M core/src/main/java/bisq/core/dao/governance/bond/unlock/UnlockTxService.java (3)
    M core/src/main/java/bisq/core/dao/governance/proofofburn/ProofOfBurnService.java (3)
    M core/src/main/java/bisq/core/dao/governance/proposal/MyProposalListService.java (2)
    M core/src/main/java/bisq/core/dao/governance/votereveal/VoteRevealService.java (3)
    A core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedBsqChangeOutputList.java (66)
    A core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedBsqChangeOutputListService.java (194)
    A core/src/main/java/bisq/core/dao/state/unconfirmed/UnconfirmedTxOutput.java (113)
    M core/src/main/java/bisq/core/offer/OfferUtil.java (4)
    M core/src/main/java/bisq/core/offer/placeoffer/tasks/CreateMakerFeeTx.java (3)
    M core/src/main/java/bisq/core/proto/persistable/CorePersistenceProtoResolver.java (3)
    M core/src/main/java/bisq/core/setup/CorePersistedDataHost.java (2)
    M core/src/main/java/bisq/core/trade/protocol/tasks/taker/CreateTakerFeeTx.java (3)
    M desktop/src/main/java/bisq/desktop/main/dao/bonding/reputation/MyReputationView.java (7)
    M desktop/src/main/java/bisq/desktop/main/dao/burnbsq/assetfee/AssetFeeView.java (7)
    M desktop/src/main/java/bisq/desktop/main/dao/burnbsq/proofofburn/ProofOfBurnView.java (7)
    M desktop/src/main/java/bisq/desktop/main/dao/governance/make/MakeProposalView.java (2)
    M desktop/src/main/java/bisq/desktop/main/dao/governance/proposals/ProposalsView.java (10)
    M desktop/src/main/java/bisq/desktop/main/dao/wallet/BsqBalanceUtil.java (6)
    M desktop/src/main/java/bisq/desktop/main/dao/wallet/send/BsqSendView.java (34)
    M desktop/src/main/java/bisq/desktop/main/dao/wallet/tx/BsqTxView.java (8)
    M desktop/src/main/java/bisq/desktop/main/offer/MutableOfferDataModel.java (5)
    M desktop/src/main/java/bisq/desktop/main/offer/takeoffer/TakeOfferDataModel.java (2)
    M desktop/src/main/java/bisq/desktop/main/overlays/windows/EmptyWalletWindow.java (4)
    M desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java (2)
    M desktop/src/test/java/bisq/desktop/main/portfolio/editoffer/EditOfferDataModelTest.java (2)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/2482.patch
https://github.com/bisq-network/bisq/pull/2482.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/bisq/pull/2482
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20190228/42a0a2bb/attachment-0001.html>


More information about the bisq-github mailing list