[bisq-network/bitcoinj] Clone transaction before adding to wallet (#18)

Oscar Guindzberg notifications at github.com
Mon Dec 31 23:58:04 UTC 2018


I had a closer look.

bitcoinj was not built to work with multiple wallet instances.
A couple of fixes where made, but there is no comprehensive solution.
On one side there is the problem of shared Transaction, TransactionInput and TransactionOutput instances.
But then we have TransactionConfidence instances which live in TxConfidenceTable and there is only one TxConfidenceTable per Context.

So,
- cloning the tx on receivePending() is a step forward. Minor performance improvement: I would move the cloning instruction to be executed after all the checks passed, ie just before commit() is executed. 
- I suggested reverting a couple of commits. I was wrong. Even if the Transaction is cloned, TransactionConfidence instance is still shared, so those commits should not be reverted.
- I am evaluating what a comprehensive solution would need. I am looking closely at Wallet's receivePending(), receiveFromBlock(), notifyTransactionIsInBlock(), commitTx(), maybeCommitTx(), reorganize(), receive(), addWalletTransaction(pool, tx) and addWalletTransaction(WalletTransaction wtx) methods to check whether more fixes are necessary. I am thinking whether a bitcoinj refactor is necessary, maybe each wallet may have its own TxConfidenceTable... just thinking out loud. I will post again after I finish my investigation.




-- 
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/18#issuecomment-450700067
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20181231/76db5198/attachment.html>


More information about the bisq-github mailing list