Commit graph

5637 commits

Author SHA1 Message Date
Steven Barclay
9f9818d673
Fix broken WalletService.getTransactionConfidence(tx, address)
Undo the earlier simplification changes to getTransactionConfidence,
which preserved its original but broken behaviour. Fix the original
stream pipeline so that each matching tx input maps to the confidence of
the connected parent tx (if any), not the child tx. In this way, it
correctly considers parent tx confidences when determining the most
recent confidence of all the matching inputs & outputs.

Before it was simply feeding a repeating list of identical objects into
getMostRecentConfidence, via the erroneous line:

  .map(o -> tx.getConfidence())

(Also add a missing @Nullable annotation & make getMostRecentConfidence
private instead of protected.)

Finally, simplify BisqWalletListener.onTransactionConfidenceChanged, by
no longer feeding a singleton list into getMostRecentConfidence whose
element is already a return value of that method, as that is a no-op.
2021-01-29 20:33:59 +00:00
jmacxx
3757ec36f7
Wording change for CashByMail suggested by @m52go 2021-01-29 11:48:27 +01:00
ghubstan
017db11217
Check wallet is avaiable and/or unlocked on createoffer
Do not attempt to create an offer if the server wallet is
unavailable.  And if the wallet is encrypted, do not attempt
to create an offer if the wallet is not unlocked.
2021-01-28 14:50:22 -03:00
jmacxx
a11d8a42c3
Add 4 missing SEPA countries AD, SM, VA, JE. 2021-01-27 23:20:30 -06:00
Steven Barclay
db26a1fe2d
Optimise TransactionAwareTrade.isRelatedToTransaction
Attempt to remove a bottleneck during the transactions view load, as
revealed by JProfiler, by optimising the code to determine if any given
transaction and trade are related. Since both these sets will tend to
grow linearly with time, causing quadratic slowdown of TransactionsView,
try to alleviate (without completely fixing) the problem.

To do this, add a cached set of disputed trade IDs to DisputeListService
so that TransactionAwareTradable.is(Dispute|RefundPayout)Tx can be made
O(1) in the common case that the given trade is not involved in any
dispute. Also avoid calling Sha256Hash::toString by passing tx IDs as
Sha256Hash objects directly to is(Deposit|Payout)Tx, and short circuit
an expensive call BtcWalletService.getTransaction in isDelayedPayoutTx,
in the common case, by pre-checking the transaction locktime.

This also fixes a bug in isRefundPayoutTx whereby it incorrectly returns
false if there are >1 disputes in the list returned by RefundManager but
the given trade is not involved in the last one.
2021-01-26 20:10:47 +00:00
Steven Barclay
97779f10d8
Use cache for WalletService.getConfidenceForAddress
Use a guava SetMultimap (a many-to-many mapping without duplicates) to
cache the set of live txs in the user's wallet with a given address as
an input or output. As with the cache of output counts from the previous
commit, compute all the tx sets in one go (by a tx stream followed by a
map inverse) and store in an ImmutableSetMultimap<Address, Transaction>,
invalidating the entire cache immediately upon each wallet change event.

This is to fix another (larger) quadratic time bug in DepositView, when
getting the confidence (i.e. confirmation count) of each wallet address.

Also simplify getTransactionConfidence & onTransactionConfidenceChanged
methods slightly, which generated (possibly unintentionally) repeating &
singleton lists of TransactionConfidence objects to pass to
WalletService.getMostRecentConfidence(..) respectively.
2021-01-26 17:43:03 +00:00
Steven Barclay
217aaf826d
Use cache for WalletService.getNumTxOutputsForAddress
Use a guava Multiset to cache the total number of tx outputs (out of the
live txs in the user's wallet) with a given address. Since this requires
a scan of the entire tx set, compute all the counts in one go and store
in an ImmutableMultiset<Address>. Invalidate the entire cache any time a
tx set change occurs, by attaching a WalletChangeEventListener to the
wallet (using a direct executor for immediate effect).

This is to fix a quadratic time bug in DepositView, which uses the count
to determine if a given address in the BTC wallet is used/unused.
2021-01-26 15:35:19 +00:00
Steven Barclay
70a13b8783
Refactor: add & remove wallet listeners from the same class
Make the WalletService.walletEventListener field private and add it via
a protected method defined in the base class, addListenersToWallet(), so
that the setup code in the two subclasses (Bsq|Btc)WalletService can be
deduplicated and more easily kept in sync with the listener removal code
in WalletService.shutDown().

Also remove some unnecessary deprecation warning suppressions.
2021-01-26 12:54:26 +00:00
jmacxx
7ea3f1c9d9
Wording change for CashByMail suggested by @m52go 2021-01-25 22:24:57 -06:00
Christoph Atteneder
cae95ce2f9
Update bitcoinj checkpoints for v1.5.5 2021-01-25 09:37:59 +01:00
Jakub Loucký
53344da9e0
Fix wording 2021-01-24 15:06:42 +01:00
Jakub Loucký
d205110d39
Add details about mediation in "Cash by mail" 2021-01-24 15:06:28 +01:00
Jakub Loucký
3ccb087da5
Fix spaces in "Cash by Mail" 2021-01-24 15:06:18 +01:00
Jakub Loucký
fafa81811b
Fix wording 2021-01-23 23:46:09 +01:00
Jakub Loucký
803d373e44
Add details about mediation in "Cash by mail" 2021-01-23 23:40:14 +01:00
Jakub Loucký
966502247b
Fix spaces in "Cash by Mail" 2021-01-23 19:21:49 +01:00
jmacxx
849f1ec45f
code cleanup 2021-01-22 20:18:23 -06:00
jmacxx
da45b8e6cf
Add pre-release software update notifications 2021-01-22 20:08:02 -06:00
Christoph Atteneder
334fbdbc86
Merge pull request #5092 from jmacxx/add_cashbymail3
Add payment method "Cash by mail"
2021-01-21 10:26:59 +01:00
Christoph Atteneder
570d6a8b38
Merge pull request #5093 from ghubstan/02-trading-scripts
Add api trade simulation scripts
2021-01-21 09:42:14 +01:00
jmacxx
2ab96d997f
Update core/src/main/resources/i18n/displayStrings.properties
Co-authored-by: m52go <735155+m52go@users.noreply.github.com>
2021-01-20 16:34:43 -06:00
ghubstan
b2d8faf2cd
Log price feed request warnings, do not throw to CLI
The price feed service throws PriceRequestExceptions when switching
currencies, log those exceptions as warnings in the server and don't
pass them up to the CLI.
2021-01-20 19:27:35 -03:00
ghubstan
d18b2d5a10
Run an async price feed request when CLI needs market price
The CLI was receiving stale, cached market prices from the feed service.
2021-01-20 17:46:35 -03:00
ghubstan
ced422e930
Add new api CLI method 'getbtcprice'
The server impl was there, but it is now needed by the trading
sim scripts (CLI) to get the price from the Bisq server instead
of the feed.  (The server does not request prices more than
once a minute.)
2021-01-20 15:01:16 -03:00
ghubstan
078f010125
Remove api dev/test log statement
This server log output was intended as an aid to api devs, but
is no longer needed after the change to posix-sytle method opts
with self explanatory labels (replacing the ambiguous positional
CLI method opts).
2021-01-20 12:03:21 -03:00
Christoph Atteneder
f0f27db83e
Fix typo in trigger price tooltip 2021-01-20 15:22:25 +01:00
ghubstan
67eed01d74
Fix tx-fee-rate opt description
For requested change
https://github.com/bisq-network/bisq/pull/5093#discussion_r560906913
2021-01-20 11:12:21 -03:00
ghubstan
72731e5c03
Add parens around (sats/byte) 2021-01-20 11:07:55 -03:00
ghubstan
11096d5c85
Fix tx-fee-rate opt description
For requested change
https://github.com/bisq-network/bisq/pull/5093#discussion_r560907371
2021-01-20 11:05:23 -03:00
ghubstan
031b18edfa
Fix typo
For requested change
https://github.com/bisq-network/bisq/pull/5093#discussion_r560906396
2021-01-20 11:02:09 -03:00
ghubstan
fce3aab40d
Improve description
For suggested change
https://github.com/bisq-network/bisq/pull/5093#discussion_r560905251
2021-01-20 10:59:49 -03:00
ghubstan
86758414b7
Fix punctuation
For suggested change
https://github.com/bisq-network/bisq/pull/5093#discussion_r560902858
2021-01-20 10:45:41 -03:00
ghubstan
71ffa0f997
Explain that paid tx fees are forfeited
For suggested change
https://github.com/bisq-network/bisq/pull/5093#discussion_r560901896
2021-01-20 10:41:21 -03:00
chimp1984
ccc6f3f466
Do not pass proxySocketFactory to BlockingClientManager
if we use a local Bitcoin node.
2021-01-19 15:08:49 -05:00
ghubstan
fbc31a5e86
Merge branch 'master' into 01-add-method-help-docs 2021-01-19 10:23:41 -03:00
jmacxx
531e8ca408
Add CASH_BY_MAIL to TradeStatistics3 enum 2021-01-19 07:12:14 -06:00
Christoph Atteneder
728439eecb
Merge pull request #5077 from stejbac/fix-reimbursement-validator
Fix request amount bounds in ReimbursementValidator
2021-01-19 11:00:17 +01:00
Christoph Atteneder
3d9e2a5ad8
Merge pull request #5083 from stejbac/fix-btc-node-converter-test
Avoid reverse DNS lookup in BtcNodeConverterTest
2021-01-19 10:37:27 +01:00
Christoph Atteneder
3f5c455f06
Merge pull request #5091 from jmacxx/test2
Reword "trade started" popup messages per suggestion
2021-01-19 10:27:43 +01:00
Christoph Atteneder
88c4272c63
Merge pull request #5080 from chimp1984/do-not-require-reason-for-payment
Change rule for "reason for payment" field to not use trade ID but leave it empty
2021-01-19 10:01:52 +01:00
jmacxx
3839f5961c
codacy 2021-01-18 21:58:14 -06:00
jmacxx
e11209d395
Add payment method "Cash by mail" 2021-01-18 21:15:18 -06:00
jmacxx
d7339196b7
Fix apostrophe; add message about discussing reason for payment text. 2021-01-18 19:35:17 -06:00
jmacxx
a90d606c01
Reword trade started popups per @m52go suggestion 2021-01-18 16:43:43 -06:00
Steven Barclay
3dd552c2b3
Avoid reverse DNS lookup in BtcNodeConverterTest
Prevent failure of testConvertClearNode() on some machines, caused by
use of InetAddress.getHostName on the mock peer address. This does a
reverse DNS lookup and potentially returns something other than the
expected "192.168.0.1" string.

Also avoid an unnecessary getHostName() call on the SOCKS5 Tor proxy
InetAddress in WalletConfig, by using an alternative InetSocketAddress
constructor.
2021-01-18 16:21:52 +00:00
ghubstan
04657d9054
Explain example 2021-01-17 12:59:54 -03:00
ghubstan
44c11922a6
Add method help docs 2021-01-17 12:58:26 -03:00
sqrrm
d3971ef7dd
Merge pull request #5072 from chimp1984/persist-and-republish-mailbox-messages
Persist and republish mailbox messages
2021-01-16 20:24:13 +01:00
ghubstan
13d0d3e9f1
Add method help doc 2021-01-16 15:43:59 -03:00
ghubstan
9efeee83e3
Explain example 2021-01-16 15:35:43 -03:00