Ensure the trade statistics list in TradesChartsView doesn't go stale
upon new stats arrivals, by moving a fillList() call from the currency
combobox onChangeConfirmed event handler to the selectedTradeStatistics
(TradesChartsViewModel field) listener.
Also avoid unnecessary use of an ObservableList as a temporary variable.
Add a nested class of lazy fields to (Deposit|Transactions)ListItem,
together with an associated memoised Supplier, lazyFieldsSupplier, which
initialises them all the first time any one of them is requested. Move
the txConfidenceIndicator & tooltip fields to this class, so that they
are only loaded when the given address/tx row is displayed in the
deposit/transactions views, respectively.
This prevents a minor bottleneck, as profiling indicates that creating a
tooltip for each tx confidence indicator in the list is quite expensive
and takes up around half the rendering time. (There may be 1000's of txs
or addresses in an old wallet.)
Fix a serious memory leak in DepositListItem due to missing removal of
the BalanceListener (one per item) from BtcWalletService. This prevented
GC of the entire list of items, which was observed to leak ~500 MB in
JProfiler after repeated switching (several dozen times) between tabs.
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.
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.
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.
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.
The general rule is limit calls that change p2p data to 1/minute,
others to 1/second. An exception is made to set/remove wallet password
methods (1/5s), due to the latency of writing wallet changes to disk.
This change may affect api testing in the future. If that happens,
further changes to the call rate metering interceptor may be made to loosen
the constraints when running in regtest/dev mode.
- trims whitespace from numeric input fields before parsing
- adds percentage display of the tx fee
- validates that the tx fee percentage is not higher than 10%
- trims whitespace from numeric input fields before parsing
- adds percentage display of the tx fee
- validates that the tx fee percentage is not higher than 10%
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.
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.)