Commit Graph

10594 Commits

Author SHA1 Message Date
Miles Petrov
872a704508
Reduce number of decimals shown for monetary fiat prices to 2 (#3926)
* Remove decimals for displayed fiat volume amounts

* Reset rounded for privacy info when switching between payment methods

Co-authored-by: Christoph Atteneder <christoph.atteneder@gmail.com>
2020-02-05 17:49:55 +01:00
Christoph Atteneder
7a0c34b8ad
Merge pull request #3940 from ripcurlx/fix-duplicate-wallet-setup-for-local-nodes-on-mainnet
Use LocalBitcoinNode as singleton
2020-02-05 17:19:29 +01:00
Christoph Atteneder
ba12943920
Make sure that class is only instantiated once
This fixes an error when running a local Bitcoin Core for Mainnet
caused by a duplicate wallet setup
2020-02-05 16:56:59 +01:00
sqrrm
3748a7eee4
Merge pull request #3938 from ripcurlx/temporarily-deactivate-public-network
Temporarily deactivate public network option
2020-02-05 11:04:19 +01:00
Christoph Atteneder
161f3b85a4
Temporarily deactivate public network option
This will be in place until we are able to check if a connected
Bitcoin Core is configured properly for our requirements
2020-02-05 10:31:25 +01:00
Christoph Atteneder
3183f5f732
Minor code cleanups 2020-02-05 10:29:55 +01:00
sqrrm
6a9f340c20
Trade process refresh (#3922)
* Add keyboard shortcut for trade process refresh, fix #3905

Trades have been getting stuck in the `Wait for payment` state, perhaps
due to lost mailbox messages, but it's hard to know for sure. There is
currently no way to get out of this state except going to mediation.

With ctrl+R the seller can ask the buyer to refresh the current trade
state and the buyer will resend the
`CounterCurrencyTransferStartedMessage` if they are in the phase
FIAT_SENT.

* Disallow more than one trade refresh per day

* Add refresh button for seller step 2, fix #3905

A seller can ask to refresh the trade process once every 24 hours. This
step has been a problem causing a lot of mediation lately so this is a
way to ask the buyer to resend the CounterCurrencyTransferStartedMessage

This fixes the problem when a mailbox message was lost. To test the
seller need to not get the first CounterCurrencyTransferStartedMessage
sent by the buyer, for example by letting the seednode drop it instead
of sending to the seller. When button is pressed
- a RefreshTradeStateRequest is sent from seller to buyer
- the buyer receives the RefreshTradeStateRequest and
 - ignores it if it's not in FIAT_SENT phase
 - responds with a CounterCurrencyTransferStartedMessage if in FIAT_SENT
   phase and has already sent a CounterCurrencyTransferStartedMessage

* Fix codacy remarks

Move incoming message handling method to the right section

* Add refresh button info text

Hide refresh section when not available rather than graying out

Added info text:
Sometimes P2P network messages acknowledging payment are not delivered,
causing trades to get stuck. Hit the button below to make your peer
resend the last message.

* Fix codacy issues
2020-02-04 15:54:47 +01:00
Christoph Atteneder
d6de99c2a1
Merge pull request #3937 from freimair/remove-uid
Remove unused uid in pricefeed service
2020-02-04 15:50:13 +01:00
Florian Reimair
af939e66e0
Remove unused uid in pricefeed service
Bisq frequently (once per minute) queries our price nodes for up-to-date
price information. It does so by HTTP GET request. However, it provided
a UID via the "User-Agent" HTTP header field. This UID has been a random
number which changed everytime Bisq got started up.

This UID has never been used. Thus, remove it.
2020-02-04 15:03:17 +01:00
sqrrm
cd745717fa
Merge pull request #3933 from ripcurlx/accept-tradestatistic-objects-before-cut-off-date
Accept old trade statistic object
2020-02-04 12:11:23 +01:00
dmos62
a452a31cef
Add new BSQ issued v. burnt chart (#3910)
* Add new BSQ issued v. burnt chart

Adds a new two-line chart that plots the month-bucketed BSQ issued and
burnt series. Until now there wasn't a direct visual means of
examining BSQ issue and burn together. This chart aims to fix that.

* Change wording from 15 days to 15-day moving average

Co-Authored-By: Steve Jain <mfiver@gmail.com>

* Make chart's title more clear

"BSQ issued v. burnt" > "BSQ issued v. BSQ burnt"

Co-Authored-By: Steve Jain <mfiver@gmail.com>

* Fix spacing between chart and title

* Reduce title-chart spacing from 20 to 10

Co-authored-by: Steve Jain <mfiver@gmail.com>
2020-02-03 17:13:14 +01:00
Christoph Atteneder
112aaf9910
Not set depositTxId to null by default
This prevents unnecessary load on the seednodes from old clients
loading all trade statistic objects on startup as they interpret
the null value as empty string
2020-02-03 15:46:33 +01:00
Christoph Atteneder
ff10857fe6
Merge pull request #3925 from sqrrm/dump-delayed-tx
Dump delayed tx
2020-02-03 12:03:25 +01:00
Christoph Atteneder
9bf3165e02
Merge pull request #3934 from sqrrm/allow-missing-multisig-entry
Finalize multisig payout even on missing address entry
2020-02-03 11:40:48 +01:00
Christoph Atteneder
2ad279f99e
Accept old trade statistic object
The code didn't handle before the use case of new trade statistic objects
created by two old clients. This change make it independent of the cut off date
and allows us at a later point to update all trade statistics objects with
depositTxId value of null.
2020-02-03 11:37:56 +01:00
sqrrm
3470b73084
Finalize multisig payout even on missing address entry
The check for an address entry before finalizing the multisig payout
might prevent a valid payout when the initiation of the trade process
was interrupted. It's better to allow the completion of the trade
and just log a warning.
2020-02-03 11:03:20 +01:00
sqrrm
cad09aabfd
Merge pull request #3921 from HirotoTanaka114/master
Re-ordering Stream APIs
2020-01-31 10:20:58 +01:00
T-hiro10
c378caf354
re-order distinct and sorted 2020-01-31 02:40:10 +09:00
sqrrm
4e4ac96885
Merge pull request #3911 from ripcurlx/redact-deposittxid-from-tradestatistics
Redact deposittxid from tradestatistics
2020-01-30 16:52:43 +01:00
sqrrm
809e1c83d1
Dump delayed payout tx hashes to file
Use a separate file, delayed_payout_txs, to write all txs and their
delayed payout tx hashes as json. This will enable users to publish
locked txs when their data dir has been corrupted, as long as the trade
data is there.
2020-01-30 16:16:57 +01:00
sqrrm
afac8e5a30
Add dumpDelayedPayoutTxs config option 2020-01-30 15:40:23 +01:00
Christoph Atteneder
1d9fda74b9
Not expose offer fee tx id in UI or JSON export 2020-01-29 14:50:09 +01:00
Christoph Atteneder
2887ab0bc5
Not add the deposit transaction id to the trade statistics object 2020-01-29 14:46:35 +01:00
Christoph Atteneder
3374f1b65c
Remove deprecated code parts
As we don't have any arbitrators connected to the network anymore it shouldn't possible to use arbitration anymore
2020-01-29 13:44:25 +01:00
niyid
f2202736da
Fixes issue 3899 - issue not yet reproduced but structured code to (#3920)
prevent occurrence of issue.
2020-01-29 11:36:41 +01:00
wiz
02e7448bda
Various improvements to seednode service / install scripts (#3882)
* Split seednode systemd service ExecStart command into multiple lines

* Add setting in seednode configuration to specify btcnode host/port

* Tweak seednode torrc configuration options to improve P2P connectivity

* Require bitcoin.service from bisq-seednode.service via systemd binding

* Make seednode installer run from master and build bisq from release tag

* Seednode must be shutdown using `kill -9` until #3884 is fixed

* Fix seednode uninstall script to use correct service names

* Disable CircuitBuildTimeout in seednode Tor configuration

* Disable seednode torrc advanced configuration options for now
2020-01-29 11:28:12 +01:00
beingindot
e890c4138d
Refactoring of and function in ValidationResult class (#3838)
* Refactoring of and function in ValidationResult

This function didnt have terminating short circuit which is important
for and operator functions. Also this function gets called multiple
times since it's validation function. hence improving needed here.

After verifying usages, left out following two classes
1. PercentageNumberValidator - since it's using only two validation
2. PhoneNumberValidator - have variable inputs and this is only place.

* Fix code format issue

Co-authored-by: Christoph Atteneder <christoph.atteneder@gmail.com>
2020-01-29 11:27:01 +01:00
Christoph Atteneder
b0f3a5036b
Merge pull request #3907 from wiz/liquid
List Liquid Bitcoin (L-BTC)
2020-01-29 10:53:06 +01:00
sqrrm
32244cd4b9
Merge pull request #3912 from ripcurlx/update-codeowners-file
Reduce codeowners to the required minimum
2020-01-27 17:33:14 +01:00
Christoph Atteneder
39ee61376d
Add wiz as codeowner for seednode configuration changes 2020-01-27 16:50:15 +01:00
Christoph Atteneder
04868cde92
Merge pull request #3914 from stejbac/fix-trades-charts-memory-leak
Prevent memory leak in CandleStickChart & VolumeChart
2020-01-27 16:42:40 +01:00
Christoph Atteneder
4243236107
Merge pull request #3909 from stejbac/fix-silent-sound-player-resource-leak
Fix potential resource leak in AvoidStandbyModeService
2020-01-27 15:51:11 +01:00
Christoph Atteneder
525fbe2bf2
Merge pull request #3904 from wiz/remove-third-party-btcnodes
Remove btcnodes not operated by Bisq btcnode team members
2020-01-27 15:47:11 +01:00
Christoph Atteneder
a29d4903a6
Merge pull request #3890 from dmos62/dao-facts-and-figures-outlier-resistance
Improve readability of the daily burnt BSQ chart
2020-01-23 15:18:46 +01:00
wiz
6fa31b34d7
Add L-BTC popup requiring users to disclose amountblinder key to mediators 2020-01-23 04:17:02 +09:00
Steven Barclay
7b7ea6453b
Prevent memory leak in CandleStickChart & VolumeChart
Ensure that the superclass methods XYChart.removeDataItemFromDisplay &
XYChart.removeSeriesFromDisplay are always called from the implemented
dataItemRemoved & seriesRemoved methods respectively, as specified by
the API javadoc.

This prevents a leak of old Candle & VolumeBar objects every time the
trades charts view is updated. The former is quite substantial, as each
Candle object has a retained size of about 70kB and there are up to 90
candlesticks / volume bars leaked per chart update.
2020-01-22 11:02:12 +00:00
Christoph Atteneder
c403ee7723
Minor code cleanups 2020-01-22 11:34:15 +01:00
Steven Barclay
a073dbf13b
Fix potential resource leak in AvoidStandbyModeService
Replace tail recursion of the play() method with an ordinary loop, to
prevent a new open JAR resource InputStream + sound file OutputStream
(which were created every 4 minute playback) from accumulating on the
stack, closing them inside the loop instead. (This also prevents
eventual stack overflow.)

Also tidy up FileUtil.resourceToFile and put the JAR URL InputStream in
a try-with-resources block, to ensure that it doesn't leak either.
2020-01-22 10:01:34 +00:00
Christoph Atteneder
c866396f86
Reduce codeowners to the required minimum
This is done to deactivate auto assignment of reviewers
in most cases and should encourage everyone to start
reviewing PRs on their own.
2020-01-22 10:14:31 +01:00
sqrrm
d4e566f6e7
Merge pull request #3889 from cbeams/refactor-option-handling
Refactor option handling
2020-01-21 17:08:09 +01:00
wiz
0adf889f94
Add L-BTC to list of main crypto currencies 2020-01-21 22:20:22 +09:00
Chris Beams
dd5690fe2a
Fix code quality issues
Per Codacy report at
https://app.codacy.com/gh/bisq-network/bisq/pullRequest?prid=4835062

Note that the items claiming that bisq.common.config.Config.* is an
unused import are false positives. These imports are in fact used in
every case.
2020-01-20 16:47:54 +01:00
Chris Beams
efba975813
Avoid race condition in LocalBitcoinNodeTests
Previously, Travis CI was failing non-deterministically due to a race
condition in which a thread was started in order to call the blocking
ServerSocket.accept() method, and sometimes the subsequent attempt by
LocalBitcoinNode.detectAndRun() to connect to that socket's port would
occur before the thread had actually called the accept() method.

This commit simplifies the approach by removing the thread entirely. As
it turns out, calling accept() is not necessary; simply constructing a
new ServerSocket() binds to and listens on the given port, such that a
subsequent attempt to connect() will succeed.
2020-01-20 16:47:54 +01:00
Chris Beams
37b669c710
Make Config option fields public and inline accessors
See updated Config Javadoc for rationale.
2020-01-20 16:47:54 +01:00
Chris Beams
4ac46e4717
Reorder a few of the most important options
There is currently no explicit rule for how option-related elements are
ordered in the code, but it is important to understand that the order in
which options are registered via parser.accept() calls is the order in
which they appear in --help output.

It would be nice to group options together into sections and separate
them in the --help output with section headers similar to the way that
Bitcoin Core's help output does it, but this is not a built-in option
with the JOpt Simple library, and not worth trying to hack into place at
the moment.
2020-01-20 16:47:53 +01:00
Chris Beams
d5abc97b04
Document Config and related types 2020-01-20 16:47:53 +01:00
Chris Beams
fe506098af
Introduce Config testing facilities
Previously ConfigTests constructed Config instances with string-based
options, e.g.:

    Config config = new Config("--appName=My-Bisq");

The advantage here is clarity, but the downside is repetition of the
option names without any reference to their corresponding Config.*
constants.

One solution to the problem would be to format the option strings using
constants declared in the Config class, e.g.:

    Config config = new Config(format("--%s=My-Bisq", APP_NAME));

but this is verbose, cumbersome to read and write and requires repeating
he '--' and '=' option syntax.

This commit introduces the Opt class and the opt() and configWithOpts()
methods to ConfigTests to make testing easier while using constant
references and preserving readability. e.g.:

    Config config = configWithOpts(opt(APP_NAME, "My-Bisq"));

In the process of making these changes a bug was discovered in the
monitor submodule's P2PNetworkLoad class and that has been fixed here as
well.

This change also required introducing several option name constants that
had not previously been extracted in order to be referenced within
ConfigTests. For consistency and completeness, all additional option
names that did not previously have a contstant now have one.
2020-01-20 16:47:53 +01:00
Chris Beams
63489c13f2
Throw if --configFile value does not exist
Previously (as of the prior commit), a warning was issued if a
non-default config file path was specified at the command line, and then
the default config file path was used as a fallback. On review, however,
it would be better to halt execution immediately if the config file does
not exist. There is no risk of breaking backward compatibility by doing
this as Bisq never had a --configFile option before the recent commits
that introduce it. Furthermore, there is no clear benefit to the
fallback approach. If the user specifies a given config file and it does
not exist, they may not see the warning message in the log, and they may
be left with the impression that they are running against their custom
config file when in fact they are running against the default (which may
be empty or non-existent itself). Thus throwing an exception as is now
done in this commit should make everything more explicit and clear.
2020-01-20 16:47:53 +01:00
Chris Beams
3d991e009a
Qualify relative --configFile value with appDataDir
This behavior had already been implemented prior to this commit, but has
now been tested and improved with refactoring and logging messages.

Note that this approach emulates Bitcoin Core's own behavior. When
running, for example, `bitcoind -conf=rel/path/to/bitcoin.conf`, the
relative path is prefixed / fully qualified by the value of the
`datadir` option. So if `datadir` equals `~/Library/Application
Support/Bitcoin`, then the `conf` option value above would be fully
qualified as

    ~/Library/Application Support/Bitcoin/rel/path/to/bitcoin.conf

If the argument to `-conf` is an absolute path, e.g.
`/tmp/bitcoin.conf`, then that absolute path is used without further
modification or qualification. It is assumed that the rationale for this
behavior is to avoid accidentally running against the wrong conf file
because `bitcoind` was invoked in a different directory than usual or
because a malicious actor replaced the relative conf file with their own
version.

Bisq's new `--configFile` option works (and is now tested to work) in
the same way: relative paths get prefixed by the value of
Config.getAppDataDir(), and absolute paths are processed unmodified.
2020-01-20 16:47:52 +01:00
Chris Beams
e1f54e95b1
Rename and reorder test for nonexistent --configFile
This test is now named consintently and sorted next to other config file
tests.
2020-01-20 16:47:52 +01:00