Commit graph

11290 commits

Author SHA1 Message Date
sqrrm
a1ec59f36f
Merge pull request #4247 from cd2357/feeservice-support-multiple-endpoints
Extend FeeRateService to support multiple API endpoints
2020-05-25 15:24:59 +02:00
sqrrm
4a6dd93393
Merge pull request #4246 from wiz/increase-bsq-explorer-tmpfs-size
Increase BSQ explorer TMPFS allocation to 2GB for growing datastore
2020-05-25 15:19:45 +02:00
sqrrm
23083840b1
Merge pull request #4239 from cd2357/add-link-to-contributors-docu-commit-msg-checks
Extend CONTRIBUTING.md with info on IDEA settings
2020-05-25 14:59:52 +02:00
Dominykas Mostauskis
3dc13b6eff
Fix reversed ordering in altcoin market 2020-05-25 11:37:30 +02:00
sqrrm
8bffcd62be
Merge pull request #4229 from petrhejna/1387-add-memo-field
Add memo field to withdrawal transaction
2020-05-19 17:05:46 +02:00
Chris Beams
2e33c2c87a
Merge pull request #4214 from ghubstan/rpc-wallet-protection
Add rpc wallet protection endpoints
2020-05-18 14:18:05 +02:00
Chris Beams
7f05f379ab
Remove unused import
This should have been done in commit c7a6c87b.
2020-05-18 14:11:50 +02:00
Chris Beams
d53cc38fde
Wrap comments at 90 chars
Per https://github.com/bisq-network/style/issues/5
2020-05-18 14:08:35 +02:00
Petr Hejna
4c8e89eaa7
Opening a take/create offers closes previously openned tab 2020-05-16 19:09:51 +02:00
sqrrm
2bd4f1a709
Merge pull request #4258 from jmacxx/fix_stale_qrcode_display
Prevent transient negative missingCoin amount sent to QRCode display
2020-05-16 12:52:55 +02:00
Petr Hejna
5352d9b44e
Fix lcode style 2020-05-15 23:17:46 +02:00
Petr Hejna
fbefb9db8e
Better working for memo text 2020-05-15 23:16:18 +02:00
Petr Hejna
335290e464
Revert uneedech whilechars changes 2020-05-15 23:16:18 +02:00
Petr Hejna
e27df8f16a
Remove unnecesary protobuf Transaction (memo is alreay in bitcoinj Transaction object) 2020-05-15 23:16:18 +02:00
Petr Hejna
8d5f42f122
Add memo field to withdrawal transaction
- "Memo" field is modeled as property of the new object Transaction which is stored in persitant storage.
- Transaction object is modeled in a way that allows extension in the furure for more persisted attributes.
2020-05-15 23:16:17 +02:00
Dominykas Mostauskis
2b797dafed
Secondary sort order for offer book
A rewrite of @freimair's PR
https://github.com/bisq-network/bisq/pull/4168.

Adds a secondary sort order of offers in market offer book by offer
amount that goes from high to low. Also, refactors-away overcomplicated
previous implementation of primary sort.

Co-authored-by: Florian Reimair <office@florianreimair.at>
Co-authored-by: cd2357 <15956136+cd2357@users.noreply.github.com>
2020-05-15 19:15:17 +02:00
jmacxx
ea8657e8e0
Fix trade withdraw to external wallet step 4
The routine `cleanUpAddressEntries` in TradeManager was prematurely
releasing funds associated with trades when they reach the last
step of the process (Step 4, Withdraw to External Wallet).
Usually, with a single trade active this would not be an issue
because `cleanUpAddressEntries` is called after the withdrawal,
but if you have more than one trade at Step 4 then the first
withdrawal would go though, but all the others would fail with
an error box "Missing x.xxx BTC" (the trade proceeds or deposit
amount).  Alternatively, if you restart the bisq app with a
trade in Step 4, the same cleanup will occur and the attempt
to withdraw to external wallet will fail.
The change here considers any trade held by the TradeManager to
be in use and therefore will not have their associated address
entries freed up.  After Step 4 has passed, the trade is no
longer held by the TradeManager, and so cleanUpAddressEntries
will at that point free up the address.
2020-05-15 12:07:59 -05:00
jmacxx
d516ba4a59
Display payment method column in Open Offers view
Adjust widths of existing columns to fit in a column for payment method.
Fixes #3902
Fixes #4125
2020-05-15 09:06:48 -05:00
jmacxx
69e46b7025
Prevent transient negative missingCoin amount sent to QRCode display
In bisq-network/bisq/pull/4223 a fix was made to the QRCode display
of amount needed to fund an offer.  This accidentally introduced a
bug whereby if the user overpaid the funding, then the QRCode would
throw an error `Coin must be positive`.  This is due to a race
condition in OfferDataModel which was setting a property first
to a negative amount before checking if it was negative and if so
then setting it to zero.  The fix here is to check for negative
before setting the property so that any listeners do not get an
event (negative) followed by another event (zero).
2020-05-14 20:24:17 -05:00
ghubstan
9178ad7a31
Fix unlockwallet timeout override bug
The CoreWalletService should never be running more than one wallet lock
TimerTask at any given time, and the wallet should lock at the correct time
after a user overrides a prior timeout value.

The CoreWalletService now cancels any existing lock TimerTask thread
before creating a new one, to prevent the wallet from re-locking at
unexpected times.

This change prevents error conditions created in scenarios similar to
the following:

  (1)  User unlocks wallet for 60s
  (2)  User overrides unlock timeout by calling unlockwallet "pwd" 600s
  (3)  After 60s, the 1st, uncanceled lock timeout expires, and wallet is
       locked 4 minutes too soon.
2020-05-13 12:30:39 -03:00
jmacxx
f2f519ada6
Display correct trade and tx fees in CSV export
When exporting trade history to CSV, users would expect to see
their own transaction and trade fees listed.  Maker fees are
stored on the Offer, Taker fees are stored on the Trade object.
The code was not properly checking whether the user was the
Offer Maker or Taker, and as such the report was always displaying
the Taker information for Tx and Trade fee.  Therefore any trades
where the user was Maker showed the wrong fees.

The column title `Maker Fee` is incorrect and misleading since
the user doing the export is not necessarily the Maker.  We
rename this column to `Trade Fee` to indicate that it is the fee
the user paid for trading regardless of Maker/Taker status.

Fixes #4207
2020-05-12 15:17:10 -05:00
sqrrm
5e5d7d1577
Merge pull request #4225 from cd2357/show-min-max-orderbook
OfferBook: Show min-max range for amount and volume
2020-05-12 12:54:55 +02:00
sqrrm
6d108ead2f
Merge pull request #4182 from jmacxx/fix_issue_2798
Editing an offer should not allow the BTC amount to be changed
2020-05-11 15:45:22 +02:00
sqrrm
d51c4c82e0
Merge pull request #4178 from jmacxx/fix_issue_3871
When accepting an offer do not round the BTC amount outside range
2020-05-11 15:18:47 +02:00
sqrrm
c07988faf3
Merge pull request #4159 from stejbac/remove-unused-PersistableEnvelope-types
Remove PersistableNetworkPayloadList & TradeStatisticsList
2020-05-11 14:52:04 +02:00
Chris Beams
7064f0f2fe
Rename properties used to configure mempool hostnames 2020-05-11 11:45:33 +02:00
Chris Beams
c79bf3edf1
Eliminate unnecessary use of GenericXmlApplicationContext 2020-05-11 11:45:33 +02:00
Chris Beams
714e49461f
Rename BitcoinFeeRateProvider to MempoolFeeRateProvider
The BitcoinFeeRateProvider name was never great; it should technically
have been something like EarnDotComFeeRateProvider. This change renames
the class to reflect that it (and its new subclasses) are specifically
designed to query the Mempool API as found at https://mempool.space.
2020-05-11 11:45:33 +02:00
Chris Beams
d160d9ec5f
Restore BitcoinFeeRateProvider to package-private visibility
This class had been made public in order to access the MIN/MAX_FEE_RATE
fields and to construct dummy instances in FeeRateServiceTest. This
introduced package cycles between bisq.price.mining and
bisq.price.mining.provider, making the implementation more difficult to
understand and maintain. This commit moves these fields to the
already-public FeeRateProvider base class, where they make more sense
to reside anyway. It also reworks tests to remove the need to access
BitcoinFeeRateProvider directly from FeeRateServiceTest. In the end,
BitcoinFeeRateProvider's visibility is returned to package-private as it
originally was, and all package cycles have been eliminated.
2020-05-11 11:45:33 +02:00
Chris Beams
ae4c256103
Eliminate unnecessary TestBase class 2020-05-11 11:45:33 +02:00
Chris Beams
f8c9c72bc7
Polish style
- Wrap comments at 90 chars per bisq-network/style#5
 - Wrap code at 120 chars per bisq-network/style#3
 - Remove unused imports
 - Remove extra newlines
 - Format code where appropriate
 - Remove unused Javadoc tags, e.g. @return, @param
 - End Javadoc summary sentence with a period where missing
 - Remove HTML formatting in Javadoc, e.g. extra <br>s
2020-05-11 11:45:33 +02:00
jmacxx
f4064dfcfb
Fix address validation for whitespace after comma
Typical comma separated values have a space after each comma
in order to make the list more human-readable.  In some areas
of bisq, comma separated lists are generated this way (see #4203),
but the validation of comma separated addresses was not accepting
spaces after commas.  This change to the regex allows optional
whitespace after comma separators.  A new test has been
added to validate the scenario of whitespace after comma.

Fixes #4203
2020-05-10 16:40:36 -05:00
Dominykas Mostauskis
482d09e8ad
Check if these *_MIN_AMOUNTs don't exceed 200k BSQ
Manfred [0] pointed out that COMPENSATION_REQUEST_MIN_AMOUNT and
REIMBURSEMENT_MIN_AMOUNT should be checked for not exceeding 200k BSQ
too.

[0] 4ec6bac658..fb76fd6548 (r420249962)
2020-05-10 15:01:32 +02:00
dmos62
a381cb2a4b
Fix forgotten break in switch statement #2
Without the break statement, the execution would continue through the subsequent case clauses until it encountered a break, executing `checkArgument` calls meant for `REIMBURSEMENT_MAX_AMOUNT`. More specifically, the bug would cause a failed check in the case where `inputValueAsCoin.value <= 200000000` is false.
2020-05-10 15:01:28 +02:00
dmos62
58db561d10
Fix forgotten break in switch statement #1
This omission is currently not disruptive, since the next case clause only contains a break.
2020-05-10 15:01:23 +02:00
dmos62
addf5be24b
Typo short-circuit boolean operator
Non-bug; only effect that the other instanceof is always evaluated.
2020-05-10 14:51:25 +02:00
cd2357
45636f160e
Fix unit test
Fix a unit test that failed after a few related classes were refactored.
2020-05-09 18:32:57 +02:00
cd2357
9f7eca2734
Update README.md
Add a section explaining how the mining fee average is calculated and
how the queried API endpoints can be modified.
2020-05-09 18:02:49 +02:00
cd2357
1c6a5b22a3
Scale number of fee providers using config
Automatically instantiate up to 5 parallel fee estimation providers
based on configured API endpoints in application.properties.

By default, two endpoints are active.

When none are configured, one primary provider defaults to querying
mempool.space.
2020-05-09 17:50:46 +02:00
cd2357
a5e1d75cfa
Add support for N>1 providers in FeeRateService
Extend FeeRateService with necessary logic to support multiple
BitcoinFeeRateProvider instances. Average the retrieved rates and
provide the average via the service getFee() API.
2020-05-09 16:20:09 +02:00
cd2357
efb1fd835f
Add ExchangeRateService test for N>1 providers
Add unit test which covers the scenario that an ExchangeRateService
queries multiple ExchangeRateProviders.
2020-05-09 12:43:56 +02:00
cd2357
a2c9b18f6a
Extend unit tests for ExchangeRateService
Extend the unit tests with more granular checks.
2020-05-09 12:34:02 +02:00
cd2357
1ad7169682
Add unit test for Version controller
Add unit test for existing functionality of the Version controller.
2020-05-09 09:40:52 +02:00
wiz
cd2d867c11
Increase BSQ explorer TMPFS allocation to 2GB for growing datastore 2020-05-09 12:30:15 +09:00
ghubstan
a79ae57ef0
Cache aesKey in unlockwallet, clear it in lockwallet
There is no need to decrypt and re-encrypt wallet files in the unlock
and lock wallet methods.  The temporary aesKey saved in the unlock
method will used for operations on an encrypted wallet.

There is also no need to cache a tempKeyCrypterScrypt;  this class
level variable was removed.
2020-05-07 14:21:51 -03:00
ghubstan
24248d4367
Backup wallets after each encrypt/decrypt operation
This is consistent with :desktop's PasswordView#onApplyPassword.
2020-05-06 15:40:15 -03:00
ghubstan
4262f29462
Cache temp key and crypter scrypt in unlockwallet
Cache the aesKey instead of the password in unlock wallet method,
avoiding extra overhead of deriving it from the temp password in the
lock method.

The KeyCrypterScrypt used in the unlock method must also be cached for
use in the manual lock method.  Creating a new KeyCrypterScrypt instance
in the manual lock method would have a different random salt value,
invalidating the password used in the unlock method.
2020-05-06 15:20:41 -03:00
cd2357
d3a9ce9620
Extend CONTRIBUTING.md with info on IDEA settings
Add a link to a StackOverflow answer showing how to configure IDEA to
automatically check and enforce the format of the commit message.

More specifically, the 50-character limit for the commit title and
72-character limit for the commit body.
2020-05-06 19:19:15 +02:00
ghubstan
fbb025adb1
Factor out two small duplcated code blocks 2020-05-06 12:30:59 -03:00
sqrrm
246d5ee37a
Merge pull request #4238 from bisq-network/revert-4212-bugfix-and-typofix
Revert "Bugfix and typofix"
2020-05-06 10:49:05 +02:00