Commit graph

13089 commits

Author SHA1 Message Date
cd2357
72a719dcc9
Merge remote-tracking branch 'bisq-network/release/v1.5.0' into upgrade-javafax-14 2020-11-27 16:59:23 +01:00
Christoph Atteneder
11b0a466ce
Merge branch 'master' of github.com:bisq-network/bisq into release/v1.5.0
# Conflicts:
#	core/src/main/java/bisq/core/provider/fee/FeeService.java
#	core/src/main/resources/i18n/displayStrings.properties
#	seednode/src/main/java/bisq/seednode/SeedNodeMain.java
2020-11-25 14:05:37 +01:00
Christoph Atteneder
dbb0160a35
Revert to SNAPSHOT version 2020-11-25 13:46:24 +01:00
sqrrm
3a5fba8196
Merge pull request #4838 from ripcurlx/update-resources-for-v1.5.0
Update resources for v1.5.0
2020-11-24 10:27:53 +01:00
Christoph Atteneder
f054e92cc6
Merge pull request #4843 from chimp1984/add-delay-to-exit
Add 1 sec delay before calling exit
2020-11-24 10:12:37 +01:00
Christoph Atteneder
788e0259d8
Merge branch 'release/v1.5.0' of github.com:bisq-network/bisq into add-delay-to-exit
# Conflicts:
#	core/src/main/java/bisq/core/app/BisqExecutable.java
2020-11-24 09:23:16 +01:00
Christoph Atteneder
94453cf27c
Merge pull request #4829 from chimp1984/prevent-downgrade
Check if user has downgraded to an older version
2020-11-24 09:15:47 +01:00
Christoph Atteneder
2e51805eb3
Merge pull request #4840 from oscarguindzberg/fixBitcoinSync
Upgrade bitcoinj to commit 60b4f2f
2020-11-24 09:11:39 +01:00
chimp1984
6b3a002b1c
Add 1 sec delay before calling exit
To persist in the very last moment before exit might cause problems on some OS.
We do not have confirmed that this might be an issue but to be on the safe side
we add a 1 sec. delay between persistence completed and exit.
2020-11-23 18:22:44 -05:00
Oscar Guindzberg
e667f8fbad
Upgrade bitcoinj to commit 60b4f2f 2020-11-23 14:39:26 -03:00
Christoph Atteneder
06a7d6fb14
Update translations for v1.5.0 (update 2) 2020-11-23 11:23:25 +01:00
Christoph Atteneder
dd55beabac
Update data stores for v1.5.0 (update 2) 2020-11-23 11:23:15 +01:00
Christoph Atteneder
06c16a1734
Update bitcoinj checkpoints for v1.5.0 (update 2) 2020-11-23 11:23:04 +01:00
Christoph Atteneder
3c944722e9
Merge pull request #4831 from jmacxx/json_dump_active_currencies
Create JSON files of actively traded crypto and fiat assets
2020-11-23 09:46:13 +01:00
jmacxx
53a90f9d17
create JSON files of actively traded crypto and fiat assets 2020-11-21 23:23:16 -06:00
chimp1984
9360e89ae8
Check if user has downgraded to an older version. If so require shutdown
and do not read or write persisted data.

We had recently a case where a user downgraded from 1.4.2 to 1.3.9 and
this caused failed trades and the wallet funds have been missing due to
some complexities of the wallet wegwit upgrade. The fund could be recovered
but it took quite some effort.
As downgrade is never tested and can lead to all kind of weird bugs we
should prevent that users accidentally can do it.
If there is valid reason to downgrade they can remove the version file.
2020-11-20 15:27:50 -05:00
chimp1984
df9ef80edf
Avoid nullpointer 2020-11-20 15:10:39 -05:00
Christoph Atteneder
779c059a51
Merge pull request #4827 from chimp1984/fix-typo
Fix typo
2020-11-20 18:40:02 +01:00
chimp1984
9da231ed8b
Fix typo 2020-11-20 10:28:59 -05:00
Christoph Atteneder
2fe702cf3d
Merge pull request #4825 from huey735/rename-trade-payout-option
Rename getsAll payout option string
2020-11-20 09:49:59 +01:00
Christoph Atteneder
741425fad8
Merge pull request #4789 from stejbac/fix-remaining-blackmail-vulnerabilities
Fix remaining blackmail vulnerabilities
2020-11-19 19:01:06 +01:00
Huey
604a64e4a5
Rename getsAll payout option string
Renamed it to better represent the outcome of this option since
the winning party doesn't in fact get all the funds in escrow.
2020-11-19 17:41:39 +00:00
Steven Barclay
345426fb50
Add further validation checks for delayed payout tx
Do some extra sanity checks like tx.outputSum < tx.inputSum, to rule out
any edge cases where an invalid delayed payout tx might still arise.
2020-11-19 17:30:16 +00:00
Steven Barclay
3574204e7d
Fix faulty signature check in finalizeDelayedPayoutTx
Make sure to use the segwit version of Script.correctlySpends in
TradeWalletService.finalizeDelayedPayoutTx, which requires the input
value and witness to be passed explicitly (as the latter holds the
actual signature). This was causing BuyerFinalizesDelayedPayoutTx to
fail to do any kind of signature check.

Also refactor the method slightly and remove a redundant call to
WalletService.checkScriptSig (which does the same thing as
TransactionInput.verify) in the branch used by the seller.
2020-11-19 17:19:14 +00:00
Steven Barclay
69d1e16f5e
Prevent takers from using non-segwit deposit tx inputs
Disallow non-P2WH depositTx inputs from the taker, while continuing to
allow them from the maker, so that offers created pre-v1.5.0 can still
be taken. (After some time, those inputs could be disallowed too.)

This is mainly to prevent mass blackmail attacks, where more victims'
money could be locked up than the DAO could possibly compensate them all
for. (This is probably only an attractive attack for a buyer anyway, at
least with the earlier commits.)
2020-11-19 17:19:14 +00:00
Steven Barclay
5a3b072692
Withhold witnesses in buyer->seller depositTx data, until last step
Strip all input witnesses from the depositTx message fields sent from
the buyer, until the last (DelayedPayoutTxSignatureResponse) message is
sent, where they can be bundled in as an extra field. Since the witness
data doesn't affect the final deposit tx id, the seller does not need to
know it until actually publishing the tx.

In the (fully) segwit case, this allows the buyer to prevent the seller
from publishing the deposit tx until the buyer has a valid, fully signed
delayedPayoutTx. Provide the final witness data in an extra 'depositTx'
field in DelayedPayoutTxSignatureResponse, which the seller can merge
with his depositTx witness block (for his own input signatures).
2020-11-19 17:19:13 +00:00
Steven Barclay
803035bdbb
Add new BuyerFinalizesDelayedPayoutTx task
Improve validation of the buyer's delayed payout tx (both before & after
they get the final DepositTxAndDelayedPayoutTxMessage from the peer), by
finalising it independently of the seller. This is now possible since
their 2-of-2 signature is included in the DelayedPayoutSignatureRequest.
Check that the final delayedPayoutTx received from the seller matches it
byte-for-byte (which actually makes its receipt redundant now).

This also fixes an apparent security bug, where the final validation of
the delayedPayoutTx appears to skip any kind of signature check (only a
deposit tx hash check, which is still necessary).

Finally, optimistically check the deposit tx against the input of the
prepared delayedPayoutTx received from the seller, in the case that the
former is non-malleable (that is, the fully segwit case) and thus has a
stable ID given by the hash of the buyer's preparedDepositTx.
2020-11-19 17:19:13 +00:00
Steven Barclay
f02d5ee216
Send seller's delayedPayoutTx signature to peer ASAP
Include a new 'delayedPayoutTxSellerSignature' field with the prepared
delayed payout tx sent to the buyer, in DelayedPayoutTxSignatureRequest.
This will allow the buyer to compute the final, signed delayedPayoutTx
as early as possible and withhold their deposit tx witness from the
seller until they know they have a valid delayedPayoutTx, preventing its
premature publishing in the fully segwit case. (To be done in a later
commit - for now just save the seller's delayedPayoutTx signature.)

As part of this, run the SellerSignsDelayedPayoutTx trade task at an
earlier step (just after payout tx creation) to make its signature
available to the seller ASAP. Also rename 'delayedPayoutTxSignature' to
'delayedPayoutTxBuyerSignature' in DelayedPayoutTxSignatureResponse.
2020-11-19 17:19:12 +00:00
Steven Barclay
79fa219533
Fix missing segwit case when sanitising preparedDepositTx
Make sure witness data is stripped from the seller's prepared deposit
tx, in addition to ScriptSig data, to prevent the buyer from being able
to publish it prematurely (before having signed the delayed payout tx).
2020-11-19 17:19:07 +00:00
Christoph Atteneder
77aab8a97c
Add error log to get more information on the actual problem 2020-11-19 16:51:45 +01:00
Steven Barclay
88d7d96427
Fix failing OpenOfferManagerTest & PeerManagerTest
These are failing on the tip of release/1.5.0 currently due to extra
validation added to PersistenceManager, causing the build to fail upon
merging upstream. Add missing PersistenceManager.shutDown calls to the
tearDown methods of the affected tests to fix.
2020-11-19 16:47:21 +01:00
Christoph Atteneder
ce265e48b7
Merge pull request #4816 from chimp1984/reduce-persistence-interval
Fix issues with missing persistence for trade state
2020-11-19 16:33:46 +01:00
chimp1984
a4db09fe1d
Move delay for applying mailbox messages inside onInitialized
We need to set addDecryptedDirectMessageListener without
delay as otherwise we could miss direct messages (detected
with localhost testing, with tor its likely slower and
would not have been triggered).
2020-11-19 10:19:48 -05:00
chimp1984
d6f4eed39e
Add requestPersistence call at TradeTask.complete call.
This is not really needed as we call it at each state change of the
trade but gives more redundancy in case we missed one or once
changes are applied and a dev forgets to call it.

Multiple repeated calls do have close to zero costs.
2020-11-19 09:51:06 -05:00
Christoph Atteneder
247c82b386
Merge pull request #4820 from oscarguindzberg/fixSignAes
Use AES key for signing when wallet is encrypted
2020-11-19 09:47:26 +01:00
chimp1984
da9b42fb83
Handle potential deposit confirmed state issues
The deposit confirmed state is set after we applied the mailbox messages,
which led to a task failure due wrong phase and the message was not applied.
Further it can be that the wallet is still syncing and the deposit
confirmed state is set in any time in the future.

To fix the first problem we add a bit of delay so that the trade has
been updated when we apply the mailbox messages. A better fix would be to change
the order of the methods but that is a bit tricky to get right and I dont want to
risk that for that release.

The second problem would require a large change to trigger the mailbox
processing based on wallet state. We prefer to be more tolerant with
the expected phase instead so allow the mailbox message to be processed
also in the DEPOSIT_PUBLISHED state.
This has no risks as the payout tx would be invalid anyway if the
buyer has cheated and sent the msg in not confirmed deposit tx state (only
possible with code manipulation).

A better fix would to add a listener for the wallet and process
the mailbox msg once wallet is ready and trade state set, but I
leave that for another PR.
2020-11-19 00:34:40 -05:00
chimp1984
706ec5a2ed
Add null checks for tradeManager
We get called some setter methods from protobuf methods before tradeManager is set.
2020-11-19 00:07:34 -05:00
chimp1984
438a0d8217
Remove requestPersistence in constructor as TradeManager is not set at that moment. 2020-11-18 19:58:20 -05:00
Oscar Guindzberg
5906950e1f
Calculate witness sig with AES key 2020-11-18 18:28:06 -03:00
chimp1984
6fb36dcd41
Add more requestPersistence calls 2020-11-18 12:51:53 -05:00
chimp1984
255460e5d5
Add more requestPersistence for data changes in ProcessModel and TradingPeer 2020-11-18 12:38:39 -05:00
chimp1984
9517f427b6
Refactoring: Extract requestPersistence method 2020-11-18 12:12:59 -05:00
Christoph Atteneder
457257b72a
Merge pull request #4787 from chimp1984/various-monitor-improvements
Various monitor improvements
2020-11-18 11:01:01 +01:00
Christoph Atteneder
29b2c33222
Merge pull request #4814 from jmacxx/improve_account_aging_column
Improve UI/UX for account aging column in 'Offers' section of GUI
2020-11-18 10:41:10 +01:00
Christoph Atteneder
71b6259ed5
Merge pull request #4817 from chimp1984/improve-filter
Improve filter
2020-11-18 10:12:33 +01:00
chimp1984
fa0c28adf6
Add requestPersistence calls
We relied on the shutdwon routine to be called reliably but it seems that is not the case as some bug reports show.
So we call requestPersistence at every write access of the trade object
2020-11-17 22:35:51 -05:00
chimp1984
ccfcc351f4
Clean tor dir at startup 2020-11-17 20:17:44 -05:00
chimp1984
6d7c3ad4dc
Remove dev log 2020-11-17 20:15:54 -05:00
chimp1984
bf2c94160f
Add delay between remove and add new filter
We saw that some seed nodes have 2 filters after filter update.
This should not be the case as the remove is broadcast before the
add but seems there is some issue in the P2P storage which does
not cover that correctly.
By adding a 5 sec delay between the remove and add we mitigate
that issue, though should be fixes in the P2P layer but that
will be a more complex and larger effort.
2020-11-17 20:14:44 -05:00
chimp1984
5b97b97349
Add missing fields in toString method 2020-11-17 20:12:25 -05:00