Commit Graph

5740 Commits

Author SHA1 Message Date
Steven Barclay
4b0711bfcc
Add Bitcoin Core version & health check to RpcService
Make a 'getnetworkinfo' RPC call to bitcoind immediately upon startup,
to check that the node is up (and throw a ConnectException to ensure
that the user is presented with an appropriate warning popup otherwise).
Log a warning if the node version is outside the 0.18.0 - 0.20.1 range.

Additionally, call 'getbestblockhash' to check that the chain tip is not
stale (> 6 hours old). As part of this, make sure the 'getblock' RPC
call works correctly with verbosity < 2, by fixing JSON deserialisation
of the response when the block or txs are in summary (hex string) form.

(These version & health checks are almost identical to the ones done by
the original btcd-cli4j library during RPC client startup.)
2021-01-21 10:10:31 +00:00
Steven Barclay
d595cac477
Add getNetworkInfo & getBestBlockHash RPC client methods
Provide a 'NetworkInfo' DTO class (with associated nested DTO classes),
returned by the 'getnetworkinfo' RPC method call to bitcoind. This will
be used during startup of RpcService to determine if Bitcoin Core is
available and which version it is using. Add a unit test to round-trip a
sample NetworkInfo JSON response.

Also add the missing 'getbestblockhash' RPC method, which will be needed
by RpcService to determine the Bitcoin Core node health.
2021-01-21 10:10:31 +00:00
Steven Barclay
a850adadb6
Make special case for irregular tx with segwit BSQ inputs
Selectively disable pubkey extraction from segwit inputs of a particular
tx at block height 660384 (2020-12-07), which spends spuriously created
segwit BSQ (later burned), to prevent a change in the DAO state hashes
from that point.

(Since a tx with a given ID can only appear on one chain, a fixed global
exclusion list of IDs should not cause any issues on testnet/regtest
versus mainnet. This is simpler than conditioning by block height.)
2021-01-21 10:10:30 +00:00
Steven Barclay
796097abbc
Fix data race in BitcoindDaemonTest
Prevent intermittent test failures, caused by a race between checking
whether the mock socket is closed upon accepting a new connection and
setting 'socketClosed' to true during shutdown. Waiting to accept and
then checking the flag needs to be done in a synchronized block.
2021-01-21 10:10:30 +00:00
Steven Barclay
93b46e3a40
Fix Codacy issues & deduplicate code in RpcService
Factor out shared construction logic to a new 'getBlockFromRawDtoBlock'
method in RpcService. Also add some 'NOPMD' comments in an attempt to
suppress unfixable Codacy warnings about qualified imports.
2021-01-21 10:10:29 +00:00
Steven Barclay
6ca42c0cd1
Enable extraction of segwit pubkeys from raw tx inputs
Factor out a new RpcService.extractPubKeyAsHex method, to take public
keys from the inputs of the raw transactions returned by the RPC client,
when building TxInput objects to incorporate into the DAO state. Enhance
the method to additionally support segwit (P2WPKH & P2SH-P2WPKH) inputs
(but only the first input for backwards compatibility - see code
comment). Also fix a bug when handling non-SIGHASH_ALL input signatures.

This will allow segwit BSQ to be used in proof-of-burn and issuance txs,
which need a public key associated with the tx to establish ownership of
it, when signing messages with a proof-of-burn or staking merit awarded
from a compensation issuance, respectively.

Also add unit tests for the factored-out method and add a missing RawTx
toString() method, to aid debugging the TxInput fields within the
processed block returned by RpcService.
2021-01-21 10:10:29 +00:00
Steven Barclay
8104301b52
Use new Bitcoind(Client|Daemon) & remove btcd-cli4j
Migrate RpcService over to the new block notification daemon and RPC
client based on jsonrpc4j. Drop in own DTO classes in place of the ones
defined by btcd-cli4j and rename requestBtcBlock & addNewBtcBlockHandler
to requestDtoBlock & addNewDtoBlockHandler respectively.

Also remove now redundant filtering from the logback config and update
grade-witness.
2021-01-21 10:10:28 +00:00
Steven Barclay
ac78639656
Improve exception handling in BitcoindDaemon
Wrap any exception that occurs during socket IO or within the supplied
BlockListener with a new 'BlockNotificationException'. This brings the
exception handling more in line with that of the old BtcdDaemonImpl and
makes it easier to match them downstream in FullNode.handleError.
2021-01-21 10:08:24 +00:00
Steven Barclay
4470af8edb
Add missing copyright headers to new files 2021-01-21 10:08:23 +00:00
Steven Barclay
f34231abb6
Factor out failure callback logic into new Utilities method 2021-01-21 10:08:23 +00:00
Steven Barclay
863392bc74
Factor out executor shutdown logic into new Utilities method 2021-01-21 10:08:22 +00:00
Steven Barclay
b7c7eaf1f2
Add replacement bitcoind block notification daemon
Provide a new 'BitcoindDaemon' block notification socket server, to
replace 'com.neemre.btcdcli4j.daemon.BtcdDaemonImpl'. This starts a
single service thread to listen for raw block hashes on localhost port
512*, sent by the specified 'blocknotify' shell/batch script, delegating
to a pool of worker threads to run the supplied BlockListener handler.
Unlike the original BtcdDaemonImpl class, a call to the 'getblock' RPC
method is not made automatically to supply a complete block to the
handler, instead requiring a separate, manual BitcoindClient.getBlock
invocation from within RpcService.

Also provide unit tests using a mock ServerSocket + Socket.

TODO: Use the new Bitcoind(Client|Daemon) implementations in RpcService,
 in place of btcdcli4j Btcd(Client|Daemon)Impl & remove the old library.
2021-01-21 10:08:22 +00:00
Steven Barclay
dbe4953f63
Add replacement bitcoind RPC client using jsonrpc4j
Create a new 'BitcoindClient' interface and a corresponding builder, to
replace the old 'com.neemre.btcdcli4j.core.client.BtcdClientImpl' class
from the btcdcli4j library. This is instantiated by jsonrpc4j using a
dynamic proxy. It provides only a cut down version of the bitcoind RPC
API, exposing the methods 'getblock', 'getblockcount' & 'getblockhash',
as they are the only ones currently being used by RpcService.

Add corresponding Jackson-annotated DTO classes to model the JSON
structures returned by bitcoind, very similar to the classes provided by
btcdcli4j. Note that we use Double instead of BigDecimal to represent
fractional fields (difficulties + coin amounts in BTC), as they have
more consistent Jackson (de)serialisation and appear to be able to
faithfully round-trip numeric fields produced by bitcoind. Also note
that doubles can faithfully represent any valid decimal BTC amount (that
is, with 8 d.p. of precision) up to 21 million.

For now, keep the old BtcdClientImpl instance used by RpcService in
place, as the btcdcli4j block notification daemon is dependent upon it
and would also need to be replaced.

Also add unit tests for BitcoindClient which test against sample regtest
responses, using a mock HttpURLConnection.
2021-01-21 10:08:22 +00:00
Steven Barclay
5990fcf9e7
Bring ScryptType enum up to date with latest bitcoind
Add 'witness_v1_taproot' script type to the enum and proto.pb, so that
it doesn't cause any problems when Taproot is activated and the new
script type starts showing up in RPC getBlock(..) responses (including
possibly BSQ transactions).

Also change the Java enum order (which shouldn't cause any problems as
the ordinal isn't used directly in hashCode calculations) and add the
missing 'witness_unknown' enum value to pb.proto to bring it in sync.
2021-01-21 10:08:15 +00: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
ghubstan
a133b0d7e3
Add method help doc 2021-01-16 15:35:14 -03:00
ghubstan
dab65e7f78
Fix typo 2021-01-16 15:27:46 -03:00
ghubstan
cde9a6d7c8
Add method help docs 2021-01-16 15:27:14 -03:00
ghubstan
03f6c2a4d3
Add method help docs 2021-01-16 15:04:23 -03:00
ghubstan
629f408bdf
Add method help docs 2021-01-16 13:45:07 -03:00
ghubstan
5538914cf8
Add line break 2021-01-16 12:03:06 -03:00
ghubstan
1ad7b351b6
Remove uneeded method 2021-01-15 16:33:52 -03:00
ghubstan
ec9f783eb5
Remove switch(hardcoded enum.name)
There is no need for a switch here, the doc exists or it does not.
2021-01-15 16:25:39 -03:00
ghubstan
a067ba1228
Add new CoreHelpService and method help docs
Adds all the gRPC server boilerplate, and a simple help service
that serves method help in man page format.  Help text is maintained
in text files located in core/src/main/resources/help.

Only some of the method help text files are defined in this
change, more to be added.
2021-01-14 10:19:39 -03:00
sqrrm
f838b1a475
Merge pull request #5076 from ghubstan/03-support-trigger-price
Stub out support for OpenOffer's triggerPrice in api
2021-01-14 10:34:29 +01:00
Christoph Atteneder
01bfbe7ca0
Merge pull request #5071 from jmacxx/fix_issue_5067
Show a confirmation of successfully sending BTC or BSQ from wallet
2021-01-14 09:37:20 +01:00
chimp1984
8b721e72df
Update core/src/main/resources/i18n/displayStrings.properties
Co-authored-by: m52go <735155+m52go@users.noreply.github.com>
2021-01-14 00:35:51 -05:00
chimp1984
6b7880c52e
Update core/src/main/resources/i18n/displayStrings.properties
Co-authored-by: m52go <735155+m52go@users.noreply.github.com>
2021-01-14 00:35:26 -05:00
chimp1984
cef1c056bb
Improve text, reformat tac text 2021-01-13 23:35:13 -05:00
chimp1984
c68f75c7e9
Remove instructions for using trade id as reason for payment
State to use empty field instead.
2021-01-13 23:03:04 -05:00
chimp1984
541f367e81
Dont log filter content if a filter got updated 2021-01-13 20:39:26 -05:00
sqrrm
685d79749b
Merge pull request #5065 from ghubstan/offer-protection-tools-api-integration
Integrate new protection tools into api's offer & trade services
2021-01-14 00:26:10 +01:00
ghubstan
a8d15d0161
Merge branch 'offer-protection-tools-api-integration' into 03-support-trigger-price 2021-01-13 20:03:03 -03:00
ghubstan
0e779a4bf6
Inject CoreContext into server, then set isApiUser=true
Do not set isApiUser=true based on hardcoded thread name ;-(

For requested change
https://github.com/bisq-network/bisq/pull/5065#pullrequestreview-567708569
2021-01-13 19:55:49 -03:00
cd2357
47c4e09d69
Merge remote-tracking branch 'bisq-network/hotfix/v1.5.4' into upgrade-javafax-14 2021-01-13 19:44:12 +01:00
chimp1984
d434cb3022
Sort persisted mail box messages by age and limit total number.
Add size limit.
Add log for number of persisted mailbox msg per day
2021-01-12 22:59:44 -05:00
chimp1984
c12e239fa5
Refactor: rename method 2021-01-12 17:44:04 -05:00
chimp1984
36657f5532
Use TradeMailboxMessage as type for getMessage in SendMailboxMessageTask 2021-01-12 17:43:27 -05:00
chimp1984
2b05ed54fc
Let MailboxMessage extend ExpirablePayload:
For all MailboxMessage we want to be sure they have an expire date.
Add getTTL methods and TTL value.
We use 7 days for ChatMessages and 30 days for PrivateNotificationMessages.
All others use default 15 days.
We prefer to keep them explicit and not use a default method in
ExpirablePayload or MailboxMessage.
The value in PrefixedSealedAndSignedMessage will not be used as the
sender use the TTL of the payload and pass that to the MailboxStoragePayload
where we store it in the extraMap. That way we can use different TTL even the
payload message is encrypted and we would not be able to look it up.
2021-01-12 16:14:13 -05:00
chimp1984
470230c35c
Add TradeMailboxMessage and use a TTL of 15 days
Extend TradeMailboxMessage where we had `extends TradeMessage implements MailboxMessage`
2021-01-12 16:06:13 -05:00
chimp1984
008fb3b6dc
Inline isMyMessage methods 2021-01-12 14:43:25 -05:00
chimp1984
c229c3f014
Refactor handling of DecryptedMessageWithPubKey 2021-01-12 14:36:13 -05:00
chimp1984
d353140e7a
Refactor: rename getMyDecryptedMessages method to make it more explicit
that its only used for MailboxMsg
2021-01-12 13:54:54 -05:00
chimp1984
5cdae8620b
Refactor: rename method to make it more explicit that its only used for MailboxMsg 2021-01-12 13:54:25 -05:00
chimp1984
575196c16d
Refactor handleDecryptedMessageWithPubKey to use MailboxMessage
instead of decryptedMessageWithPubKey.
Here we change a bit the behaviour as now we check also if the
TradeMessage is a MailboxMessage. As that method is only called
from MailboxMessageService domain we never get a non MailboxMessage
here anyway and it would have been a bug.

Remove removeMailboxMsg(DecryptedMessageWithPubKey decryptedMessageWithPubKey) as not used anymore
2021-01-12 13:53:20 -05:00
chimp1984
2235c4fbdc
Use removeMailboxMsg method with MailboxMessage as param type 2021-01-12 13:36:46 -05:00
chimp1984
456ce70d22
Refactor: rename dispatchMessage to onSupportMessage (no functionality change) 2021-01-12 13:32:03 -05:00
chimp1984
f536aba841
Refactor handling of removeMailboxMsg 2021-01-12 13:31:03 -05:00
chimp1984
bffe2b82a7
Store PrivateNotificationMessage instead of DecryptedMessageWithPubKey 2021-01-12 13:25:19 -05:00
chimp1984
0f087946fc
Remove unneeded wrapping of tradeMessage into DecryptedMessageWithPubKey 2021-01-12 13:25:04 -05:00
chimp1984
32aeda7468
Add null check 2021-01-12 12:47:57 -05:00
chimp1984
d39a697611
Fix wrong delay, increase timeout 2021-01-12 10:48:29 -05:00
chimp1984
320e5f1aef
Refactor: Rename method 2021-01-12 10:48:28 -05:00
chimp1984
35ef3b842f
Add support for TTL defined by payload message so we can use
different TTL for lower prio mailbox messages like AckMessages.

As we cannot add a field without breaking signatures we
need to use the extraMap in MailboxStoragePayload
2021-01-12 10:48:28 -05:00
chimp1984
a3b2aad3b0
Refactor: move class to new utils package 2021-01-12 10:48:27 -05:00
chimp1984
41a92eae7f
Refactor: Rename class 2021-01-12 10:48:27 -05:00
chimp1984
75e547fda5
Refactor: move classes to persistence package 2021-01-12 10:48:27 -05:00
chimp1984
32f887478b
Persist map for removed mailbox messages (AddOncePayload more generally)
We add the date when we add the hash so that we can remove expired data.
2021-01-12 10:48:26 -05:00
chimp1984
504fb2e6a1
Refactor: Rename 2021-01-12 10:48:26 -05:00
chimp1984
4fc35a7b39
Cleanups 2021-01-12 10:48:25 -05:00
chimp1984
b8fc7f3985
Remove sendEncryptedMailboxMessage from P2PService and use MailboxMessageService instead 2021-01-12 10:48:25 -05:00
chimp1984
33703c269c
Remove removePrivateNotification from P2PService and use MailboxMessageService instead 2021-01-12 10:48:25 -05:00
chimp1984
ee3f158f5f
Remove addDecryptedMailboxListener from P2PService and use MailboxMessageService instead 2021-01-12 10:48:25 -05:00
chimp1984
d470d736ce
Remove getMailBoxMessages from P2PService and use MailboxMessageService instead 2021-01-12 10:48:25 -05:00
chimp1984
a28a2f59df
Move mailbox related code from P2PService to MailboxMessageService 2021-01-12 10:48:25 -05:00
chimp1984
0656a52eb9
Refactor: Move mailbox related classed to mailbox package. Make constructor public. 2021-01-12 10:48:24 -05:00
ghubstan
eaf41eb2ca
Merge branch 'master' into 03-support-trigger-price 2021-01-12 11:42:25 -03:00
Christoph Atteneder
1406043f3b
Merge pull request #5078 from chimp1984/add-v2-seeds
Add 4 olds v2 seed nodes
2021-01-12 14:29:55 +01:00
sqrrm
4298c3937e
Merge pull request #5070 from chimp1984/improve-cleanup-tor-dir-at-seeds
Improve cleanup tor dir at seeds
2021-01-12 13:23:37 +01:00
sqrrm
fea52f07a3
Merge pull request #5057 from chimp1984/fix-premature-disconnections-from-seeds
Fix premature disconnections from seeds
2021-01-12 12:52:41 +01:00
chimp1984
9b026868f8
Add 4 olds v2 seed nodes 2021-01-11 23:29:51 -05:00
Steven Barclay
e0dca7d804
Fix request amount bounds in ReimbursementValidator
Use ReimbursementConsensus.get[Min|Max]ReimbursementRequestAmount in
place of CompensationConsensus.get[Min|Max]CompensationRequestAmount,
which was erroneously copied (it appears) from the very similar
CompensationValidator class.

This ensures the correct upper bound (currently 80,000 BSQ, starting at
10,000 BSQ and doubled in cycles 12, 13 & 14) is placed on reimbursement
requests, instead of the erroneous 100,000 BSQ upper bound for
compensation requests.
2021-01-11 20:13:41 +00:00
ghubstan
0c6005ed2d
Stub out support for OpenOffer's triggerPrice in api
This is a feature that will not be included in api v1, but partial
support is added in this change to the server.  CLI will pass a
default triggerPrice of 0 (unused) with the createoffer command.

When fully implemented, an optional trigger-price param will be
added to the CLI's createoffer method, and the value will only be
visible to offer owners.  New enableoffer and disableoffer
methods will also need to be added.
2021-01-11 14:36:51 -03:00
jmacxx
27d41c8499
Show a confirmation of successfully sending BTC or BSQ from wallet
The confirmation details include amount, recipient address and txId.
Includes a link to open txId details in the user's external block explorer.
@m52go reworded the BSQ conf explanation note.
Added "don't show again" checkbox.
2021-01-10 19:51:34 -06:00
chimp1984
8ecfa8bcba
We set a flag to clear tor cache files at re-start.
We cannot clear it now as Tor is used and
that can cause problems.
2021-01-09 20:40:58 -05:00
chimp1984
bf7acb5932
Add toggle for showing volume as USD instead of BTC
Precalculate the USD average prices for tick intervals
and use that for converting the BTC volume to USD volume.
2021-01-08 16:41:55 -05:00
chimp1984
764614d762
Add methods for boolean values 2021-01-08 16:41:55 -05:00
chimp1984
73fcf52129
Cache price and localDateTime 2021-01-08 16:41:55 -05:00
chimp1984
8927787286
Cache Volume
Volume was created at each access from amount and price.
To improve performance we cache the result once calculated.
2021-01-08 16:41:55 -05:00
ghubstan
9ae1a29f23
Integrate new protection tools into api's offer & trade services
- Injected OfferFilter into CoreOffersService and CoreTradesService.

  The filter constrains 'getoffer(s)' results to offers an api user
  can take, as the first part of ongoing protection tools / api
  integration.

- Created a new CoreContext singleton.

  Initially, lets Core*Services know if the user is using the api --
  isApiUser=true if the current thread's name is "BisqDaemonMain" or
  the name contains "grpc".  We do this anticipating future :desktop
  dependencies on the core api, and we don't pass hardcoded
  isApiUser=true params to lower level domain objects.

  We cannot check BisqDaemonMain.class.getSimpleName() because :core
  cannot have a circular dependency on :daemon, but there is probably a
  better way to do this than depending on the thread name set in
  BisqDaemonMain#configUserThread().

- Added @Singleton annotation to all Core*Service classes.
2021-01-08 13:22:01 -03:00
ghubstan
cc0855497e
Add @Singleton annotation 2021-01-08 12:51:48 -03:00
Christoph Atteneder
1daa58624d
Merge pull request #5061 from chimp1984/persist-failed-mailbox-msg-decryption-attempts
Persist failed attempts of decrypting mailbox messages
2021-01-08 10:35:41 +01:00
sqrrm
76e2330b15
Merge pull request #5056 from ghubstan/add-getmyoffers-api-method
Add new api methods 'getmyoffers' and 'getmyoffer'
2021-01-07 22:51:33 +01:00
ghubstan
9689c3edfc
Sort offers in stream 2021-01-07 16:07:41 -03:00
Christoph Atteneder
fdf7912bab
Merge pull request #5016 from chimp1984/increase-trade-period-for-transferwise
Change trade period for transferwise from 1 day to 4 days
2021-01-07 16:53:59 +01:00
Christoph Atteneder
6200455770
Merge pull request #5053 from chimp1984/add-protection-tools
Add protection tools
2021-01-07 16:20:26 +01:00
chimp1984
21eaea0703
Add IgnoredMailboxMap to persist failed decryption
attempts and optimize performance by that
2021-01-06 21:20:50 -05:00
ghubstan
424c3cb1ab
Avoid unnecessary comparisons in boolean expressions 2021-01-06 18:13:01 -03:00
ghubstan
80c10dba78
Fix log statement format
A log statement was mismatching argument placeholders with argument
values because it was formatted as
	log.info("msg={}, \n" + args...)
instead of
	log.info("msg={}", args...)

Some code formatting was also done to this block, and a closer approximation
of a CLI 'createoffer` param list replaces the following log statement.
2021-01-06 17:58:52 -03:00
chimp1984
e0e14431e4
Add RRT for request / response 2021-01-06 15:45:43 -05:00
chimp1984
1dc71c9b3a
Increase delay for reset
Improve statistic logging
2021-01-06 11:14:47 -05:00
chimp1984
379fec8b9d
Fix translation string 2021-01-06 09:54:38 -05:00
chimp1984
14008a670a
Add formatDurationAsWords to Utilities in common
to be accessible to the statistics log.
2021-01-06 01:49:38 -05:00
chimp1984
3fa22427c7
Set expectedRequests to 5 in case of fullDaoNode as
it does not do the getBlocksRequest.
2021-01-05 22:19:26 -05:00
chimp1984
769a78fe52
Behaviour change: Remove setAllowDisconnectSeedNodes method
We handle it in ConnectionState by counting
requests and responses and adding a timer
2021-01-05 21:42:18 -05:00
chimp1984
3d55c16c8b
Update display string and UI representation 2021-01-05 20:56:27 -05:00
chimp1984
5f977ffe6f
Use isSeedNode 2021-01-05 20:55:29 -05:00
chimp1984
0bb9d15653
Fix null pointer 2021-01-05 20:55:10 -05:00
chimp1984
86d0f96c6c
Remove PeerType from Connection. Use ConnectionState instead.
Remove unnecessary setPeerType calls. ConnectionState is handling that.
Only PeerManager does the setting of isSeedNode as we do not have the
required dependency in ConnectionState.
2021-01-05 20:50:46 -05:00
chimp1984
15cd42de0c
Add InitialDataRequest and InitialDataResponse marker interface for
relevant classes
2021-01-05 20:39:52 -05:00
chimp1984
f169cf1309
Refactoring: Move PeerType outside of Connection 2021-01-05 20:34:28 -05:00
chimp1984
db6722b335
Revert most changes with applying offerFilter. Leave it to @ghubstan to implement it. 2021-01-05 10:19:21 -05:00
ghubstan
18de222d38
Add new api methods 'getmyoffers' and 'getmyoffer'
Similar to 'getoffers' and 'getoffer', but filters out offers not
created by the user.  The new methods are so similar some offer list
filtering and sorting was refactored in CoreOffersService.

Also fixed some createoffer apitest cases in anticipation of a new OfferFilter,
which will filter out offers not matching any user payment account.
2021-01-04 21:43:34 -03:00
chimp1984
58a1f9c402
Remove getOffersAvailableForTaker method
Add offerFilter.canTakeOffer to getOffer and getOffers
2021-01-04 15:34:42 -05:00
chimp1984
c2174607f5
Add isTakerApiUser field to OfferAvailabilityRequest
Add UNCONF_TX_LIMIT_HIT and MAKER_DENIED_API_USER to AvailabilityResult enum
Apply handling for api filter features
2021-01-04 12:35:29 -05:00
chimp1984
95063b6c7f
Add denyApiTaker field to Preferences 2021-01-04 12:00:29 -05:00
chimp1984
b5af6bcfc7
Add missing Filter params in tests 2021-01-04 12:00:00 -05:00
chimp1984
cfabf79ca4
Merge branch 'add-toggle-for-hiding-not-takable-offers' into add-new-filter-entries 2021-01-04 11:48:02 -05:00
chimp1984
4bbc394b2d
Add disableApi flag to filter 2021-01-04 11:44:50 -05:00
chimp1984
9e275048f6
Add toggle for filtering offers which can be taken with users accounts 2021-01-04 11:32:56 -05:00
sqrrm
6fc9ad4c9b
Merge pull request #5021 from ghubstan/fix-annotations
Adjust lombok annotations to reduce build warnings
2021-01-04 14:57:50 +01:00
sqrrm
ffb2aa8feb
Merge pull request #5052 from jmacxx/show_offer_stats_by_payment_method
Add a 'payment method details' screen
2021-01-04 13:08:22 +01:00
sqrrm
7bc9c102d0
Merge pull request #5045 from chimp1984/add-option-to-hide-non-supported-payment-methods
Add option to hide non supported payment methods
2021-01-04 12:06:41 +01:00
sqrrm
bf7a528bac
Merge pull request #5040 from chimp1984/update-inventory-code
Update inventory code
2021-01-04 10:45:18 +01:00
sqrrm
5ae2a0f5a9
Merge pull request #5039 from chimp1984/add-option-for-seeds-doShutdownSeedOnInterval
Add option to prevent periodic shutdown for seed nodes
2021-01-04 10:38:34 +01:00
sqrrm
14d5600107
Merge pull request #5038 from chimp1984/add-filter-support-on-network-level
Add filter support on network level
2021-01-04 10:36:54 +01:00
jmacxx
99f8f7cdfc
Rename tab titles per code review suggestion
Offers by Currency & Offers by Payment Method
2021-01-03 22:39:57 -06:00
jmacxx
3488c9eb07
Add a 'payment method details' screen in Bisq client 2021-01-03 19:59:45 -06:00
chimp1984
05b993e7b9
Rename bannedNodeAddress to nodeAddressesBannedFromTrading 2021-01-03 18:53:15 -05:00
sqrrm
2be48226d9
Merge pull request #5037 from ripcurlx/fix-german-translation
Update translations and fix a broken German translation
2021-01-03 22:46:23 +01:00
sqrrm
df5baaf88e
Merge pull request #5031 from chimp1984/access-concrete-data-stores
Access concrete data stores
2021-01-03 22:43:52 +01:00
ghubstan
0c9c96165b
Re-add @EqualsAndHashCode 2021-01-03 13:39:37 -03:00
ghubstan
c2c1ac2087
Adjust class level annoations
as per suggested changes
    https://github.com/bisq-network/bisq/pull/5021#discussion_r550903787
    https://github.com/bisq-network/bisq/pull/5021#discussion_r550903843
    https://github.com/bisq-network/bisq/pull/5021#discussion_r550903860
2021-01-03 12:01:10 -03:00
ghubstan
0638701ca3
Merge branch 'master' into fix-annotations 2021-01-03 11:34:30 -03:00
chimp1984
0ce9324cf4
Add cache for signature verification results and a lookup map by ownerPubKey 2021-01-02 17:34:08 -05:00
chimp1984
eddb7cb555
Add option in preferences to hide payment methods which are not part of the users accounts.
Default value is false, so same behaviour as before the change.
If no payment account is setup then we also show all payment methods.
In that case (no payment account) we disable the toggle as well as set it to false.
2021-01-01 21:52:34 -05:00
chimp1984
16ff7c983d
Update commit hash 2021-01-01 17:27:22 -05:00
chimp1984
67c57eb202
Increase tolerance for OfferPayload 2021-01-01 17:26:59 -05:00
chimp1984
d5ef7e66d1
Add option to prevent periodic shutdown for seed nodes 2021-01-01 17:17:29 -05:00
chimp1984
c8bf1d469e
Add support to filter manager for network wide banned nodes 2021-01-01 16:51:24 -05:00
chimp1984
3cf6c60354
Add NetworkFilter, remove BanList 2021-01-01 16:51:05 -05:00
chimp1984
28dd8404f7
Merge branch 'access-concrete-data-stores' into add-filter-support-on-network-level 2021-01-01 13:50:46 -05:00
Christoph Atteneder
13e8d63837
Update translations and fix a broken German translation
dao.wallet.send.sendFunds.details
2021-01-01 18:59:22 +01:00
sqrrm
d79799aaa3
Merge pull request #5006 from Jakub-CZ/instant-error-message-update
Display up-to-date error messages under text fields
2021-01-01 17:42:50 +01:00
ghubstan
81371d477c
Merge branch 'master' into 01-misc 2020-12-31 11:58:18 -03:00
chimp1984
a3e8d4d225
Fix missing param in test 2020-12-31 00:42:23 -05:00
chimp1984
381322f600
Only publish witness if we are in date tolerance 2020-12-30 23:20:38 -05:00
chimp1984
4489e57849
Use concrete dataStorageServices instead
p2PService.getP2PDataStorage().getAppendOnlyDataStoreMap().

p2PService.getP2PDataStorage().getAppendOnlyDataStoreMap() iterates
over all services including the historical data store service. It used the
getMap method which should not be used at historical data store service as
it is not clear if the live data or all data should be accessed.
2020-12-30 20:38:42 -05:00
Christoph Atteneder
115ec78f4d
Merge pull request #5011 from chimp1984/show-stacktrace-in-error-popup-at-view-exceptions
Show stacktrace in error popup at view exceptions
2020-12-29 19:58:01 +01:00
Christoph Atteneder
94cf02303e
Merge pull request #4950 from chimp1984/improve-offer-publishing
Improve offer publishing
2020-12-29 19:51:21 +01:00
Christoph Atteneder
a2a542e11e
Merge pull request #4999 from chimp1984/persist-app-window-layout
Add generic map (cookie) to UserPayload
2020-12-29 19:44:29 +01:00
ghubstan
bb07f10990
Remove unused imports 2020-12-29 12:52:03 -03:00
ghubstan
7e24c57dc8
Adjust lombok annotations to reduce build warnings
This change fixes the underlying problems behind five compiler warnings:
"Generating equals/hashCode implementation but without a call to superclass".

Some core classes use @Value and @Data annotations where not necessary, for
example, where equals, hashCode, and toString are implemented by the developer,
and where final class and field modifiers are defined by the developer.

From lombok classes and documents for the shortcut annotations
	@Value https://projectlombok.org/features/Value and
	@Data  https://projectlombok.org/features/Data,
we find some implicit annotations applied by these shortcuts are not needed.
Adjustments are described below.

- Tx Replace @Value with @Getter.

- TxOutput  Replace @Data with @Getter and @Setter.

- ChangeParamProposal  Replace @Value with @Getter.

- GetInventoryRequest, GetInventoryResponse
  An @EqualsAndHashCode(callSuper = false) is added to supress build
  warnings.
2020-12-29 12:39:08 -03:00
ghubstan
651e772c18
Merge branch 'master' into 01-misc 2020-12-29 10:37:23 -03:00
sqrrm
9cc3f687c0
Merge pull request #4851 from chimp1984/improve-bsq-get-block-request-handling
Improve getBlocks request handling
2020-12-29 13:55:40 +01:00
chimp1984
cf1b5ef01a
Change trade period for transferwise from 1 day to 4 days 2020-12-28 14:39:07 -05:00
Christoph Atteneder
785c76e9d6
Merge pull request #5010 from chimp1984/dao-performance-improvements
Dao performance improvements
2020-12-28 20:06:58 +01:00
chimp1984
862b12fe03
Apply code inspection
Cleanups
2020-12-28 13:34:50 -05:00
chimp1984
1fc8905634
Improve logs
Cleanups
2020-12-28 13:18:45 -05:00
chimp1984
768541664b
Use stream API
Add checks to tryWithNewSeedNode method
Cleanups
2020-12-28 13:18:19 -05:00
Christoph Atteneder
195c2b8f5d
Merge pull request #4997 from chimp1984/remove-unused-code
Cleanup trade wallet code
2020-12-28 19:18:12 +01:00
chimp1984
fe44a343d0
Remove "hack" for removal of blockDownloadListener
Rename params
Cleanups
2020-12-28 13:17:06 -05:00
ghubstan
25fbd3518e
Merge branch 'master' into 01-misc 2020-12-28 14:38:39 -03:00
ghubstan
bcc7216c9e
Fix tmp file deletion bug 2020-12-28 14:30:07 -03:00
chimp1984
357c980390
Fix leftovers from debugging.
Use else if
Fix typo
2020-12-28 12:24:35 -05:00
chimp1984
0be451a136
Fix typos 2020-12-28 12:24:35 -05:00
chimp1984
5e39477fca
Refactor: Use terminate instead of cancel 2020-12-28 12:24:35 -05:00
chimp1984
5363c8d505
Remove cancel,cleanup and stop method. Use terminate instead.
Fix typo
2020-12-28 12:24:35 -05:00
chimp1984
4a05e5bf0d
Improve getBlocks request handling 2020-12-28 12:24:35 -05:00
Christoph Atteneder
976caeb14e
Merge pull request #5001 from chimp1984/deactivate-open-offer-if-trigger-price-is-reached
Deactivate open offer if trigger price is reached
2020-12-28 17:04:21 +01:00
Christoph Atteneder
78d4176f8a
Merge pull request #5004 from chimp1984/add-mediators-keybase-usernames
Add mediators keybase usernames
2020-12-28 16:50:56 +01:00
Christoph Atteneder
850e031158
Merge branch 'master' of github.com:bisq-network/bisq into release/v1.5.2
# Conflicts:
#	core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java
#	core/src/main/java/bisq/core/trade/closed/CleanupMailboxMessages.java
2020-12-28 14:57:08 +01:00
chimp1984
6fe19db233
Only check for downGrade if we are on mainnet
Its a bit annoying for dev testing when switching between release and master...
2020-12-27 23:38:17 -05:00
chimp1984
681fed603e
Fix log 2020-12-27 22:50:56 -05:00
chimp1984
7a9230ef27
Optimize getIssuance(String txId, IssuanceType issuanceType) method
We iterated all map entries instead of a simple get call.
2020-12-27 21:27:17 -05:00
chimp1984
9402ca0c64
Optimize getIssuance method
We iterated all map entries instead of a simple get call.
2020-12-27 21:24:58 -05:00
chimp1984
32cc062872
Refactor: Rename getIssuanceSet to getIssuanceSetForType 2020-12-27 21:21:48 -05:00
chimp1984
686957c809
Add comment 2020-12-27 21:20:17 -05:00
chimp1984
62ca826217
Use java doc at constructor 2020-12-26 19:47:57 -05:00