Commit Graph

804 Commits

Author SHA1 Message Date
chimp1984
80e7c452ca
Add BsqBlocks resources and update DaoState
Add BsqBlocks resources
2021-11-09 13:01:20 +01:00
Christoph Atteneder
2d3cf388eb
Merge pull request #5788 from jmacxx/fix_refresh_ttl_exception
Gracefully handle null data in refresh offer message and log error
2021-11-04 10:06:44 +01:00
chimp1984
f7fcaa915e
Add BSQ swap code 2021-11-02 16:18:50 +01:00
chimp1984
d5dfdb4a35
Merge branch 'chimp-bsq-swap-1' into bsq-swap-low-risk-refactorings-2
# Conflicts:
#	core/src/main/java/bisq/core/account/witness/AccountAgeWitnessService.java
#	core/src/main/java/bisq/core/api/CoreOffersService.java
#	core/src/main/java/bisq/core/btc/listeners/TxConfidenceListener.java
#	core/src/main/java/bisq/core/notifications/alerts/market/MarketAlerts.java
#	core/src/main/java/bisq/core/offer/OpenOfferManager.java
#	core/src/main/java/bisq/core/offer/bisq_v1/CreateOfferService.java
#	core/src/main/java/bisq/core/offer/bisq_v1/OfferPayload.java
#	core/src/main/java/bisq/core/offer/bisq_v1/TakeOfferModel.java
#	core/src/main/java/bisq/core/offer/bisq_v1/TriggerPriceService.java
#	core/src/main/java/bisq/core/proto/ProtoDevUtil.java
#	core/src/main/java/bisq/core/trade/TradeManager.java
#	core/src/main/java/bisq/core/trade/bisq_v1/TradeResultHandler.java
#	core/src/main/java/bisq/core/trade/bisq_v1/TradeUtil.java
#	core/src/main/java/bisq/core/trade/model/bisq_v1/Trade.java
#	core/src/main/java/bisq/core/trade/protocol/FluentProtocol.java
#	core/src/main/java/bisq/core/trade/protocol/Provider.java
#	core/src/main/java/bisq/core/trade/protocol/TradeProtocol.java
#	core/src/main/java/bisq/core/trade/protocol/TradeProtocolFactory.java
#	core/src/main/java/bisq/core/trade/protocol/TradeTaskRunner.java
#	core/src/main/java/bisq/core/trade/protocol/bisq_v1/DisputeProtocol.java
#	core/src/main/java/bisq/core/trade/protocol/bisq_v1/model/ProcessModel.java
#	core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/ApplyFilter.java
#	core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/TradeTask.java
#	core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/maker/MakerCreateAndSignContract.java
#	core/src/main/java/bisq/core/trade/protocol/bisq_v1/tasks/taker/TakerVerifyAndSignContract.java
#	core/src/main/java/bisq/core/trade/statistics/TradeStatistics2.java
#	core/src/main/java/bisq/core/trade/statistics/TradeStatisticsManager.java
#	core/src/main/java/bisq/core/trade/txproof/xmr/XmrTxProofService.java
#	desktop/src/main/java/bisq/desktop/components/paymentmethods/PaymentMethodForm.java
#	desktop/src/main/java/bisq/desktop/main/PriceUtil.java
#	desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionAwareTradableFactory.java
#	desktop/src/main/java/bisq/desktop/main/funds/transactions/TransactionAwareTrade.java
#	desktop/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartView.java
#	desktop/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModel.java
#	desktop/src/main/java/bisq/desktop/main/market/spread/SpreadViewModel.java
#	desktop/src/main/java/bisq/desktop/main/offer/BuyOfferView.java
#	desktop/src/main/java/bisq/desktop/main/offer/OfferView.java
#	desktop/src/main/java/bisq/desktop/main/offer/SellOfferView.java
#	desktop/src/main/java/bisq/desktop/main/offer/bisq_v1/MutableOfferDataModel.java
#	desktop/src/main/java/bisq/desktop/main/offer/bisq_v1/MutableOfferView.java
#	desktop/src/main/java/bisq/desktop/main/offer/bisq_v1/MutableOfferViewModel.java
#	desktop/src/main/java/bisq/desktop/main/offer/bisq_v1/takeoffer/TakeOfferDataModel.java
#	desktop/src/main/java/bisq/desktop/main/offer/bisq_v1/takeoffer/TakeOfferView.java
#	desktop/src/main/java/bisq/desktop/main/offer/bisq_v1/takeoffer/TakeOfferViewModel.java
#	desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBook.java
#	desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java
#	desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookViewModel.java
#	desktop/src/main/java/bisq/desktop/main/overlays/windows/OfferDetailsWindow.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/closedtrades/ClosedTradesDataModel.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/editoffer/EditOfferDataModel.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/failedtrades/FailedTradesDataModel.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersDataModel.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/openoffer/OpenOffersView.java
#	desktop/src/main/java/bisq/desktop/main/portfolio/pendingtrades/PendingTradesDataModel.java
#	desktop/src/main/java/bisq/desktop/util/DisplayUtils.java
#	desktop/src/test/java/bisq/desktop/main/offer/bisq_v1/createoffer/CreateOfferDataModelTest.java
#	desktop/src/test/java/bisq/desktop/main/offer/bisq_v1/createoffer/CreateOfferViewModelTest.java
#	desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookListItemMaker.java
#	desktop/src/test/java/bisq/desktop/main/portfolio/editoffer/EditOfferDataModelTest.java
#	desktop/src/test/java/bisq/desktop/maker/OfferMaker.java
#	monitor/src/main/java/bisq/monitor/metric/P2PMarketStats.java
2021-11-02 16:04:12 +01:00
jmacxx
28eb3f04ca
Add error log message for context 2021-11-02 09:56:24 -05:00
jmacxx
e65a992b26
Gracefully handle null data in refresh offer message and log error 2021-10-29 12:18:18 -05:00
Christoph Atteneder
8bcfbea477
Update data stores for v1.7.5 2021-10-26 11:57:36 +02:00
chimp1984
63c385bbba
Add support for RemoveDataMessage in testCapability
Refactor testCapability
2021-10-21 17:44:18 +02:00
chimp1984
23af4558b5
Add filterPredicate 2021-10-21 10:13:19 +02:00
chimp1984
b80b6ec836
Cleanups 2021-10-21 10:12:57 +02:00
chimp1984
07354191a6
Remove handling of BundleOfEnvelopes in send method.
It is basically never executed and throttling would avoid it as well.
Cleanups, Rename
2021-10-21 10:12:28 +02:00
sqrrm
5e84713520
Merge pull request #5730 from bisq-network/release/v1.7.4
Release/v1.7.4
2021-09-28 15:05:42 +02:00
Christoph Atteneder
29ede5f3c4
Update data stores for v1.7.4 2021-09-23 10:01:04 +02:00
chimp1984
4dd7061c27
Refactor service filtering
Make it more clear that we expect only one
matching service which can handle the payload.
2021-09-21 10:35:18 +02:00
chimp1984
c90c62c2cd
Remove getAppendOnlyDataStoreMap method for tests
Use appendOnlyDataStoreService.getMap(persistableNetworkPayload)
instead.
2021-09-21 10:33:25 +02:00
chimp1984
b9106b0795
Update tests 2021-09-21 01:04:13 +02:00
chimp1984
19b52ba6f6
When daoActivated is set to false the DAO P2P data
are still received from seed nodes and processed but
as the services for processing the payloads are not
added the data is inefficiently processed.
The getMap returned a flattened map of all maps in
all services which can be quite large.
We use now a filtered map with calling canHandle
first. Also the put got optimized to indicate in the
return value if there has been a service found to add
the payload. If not we do not invoke the listeners and
do not broadcast.

To not request the DAO P2P data would be better but I
don't see a easy way how to do that as the P2P network
is not aware of the type of data. Some market interface
could be used and a flag at the request to the seed node
to indicate if those types should be included but that
does feel too customized for a special use case. The
DAO P2P data is not that big as well, so I think for now
that fix should be good enough.
2021-09-20 23:59:17 +02:00
ghubstan
7351b08850
Reduce # of hash calculations in UI OfferBook view
We can cache an offer payload hash as soon as its `offerFeePaymentTxId`
is set.  (The payload hash cannot be calculated until the object can
be transformed into a protobuf message, which requires a non-null
offerFeePaymentTxId.)

Another benefit is removal of the payload hash argument from the
`OfferBookListItem` constructor.

Changes include

- `OfferPayload` Added `transient byte[] hash` field + getter method
   (where hash is calculated and cached).

- `OfferBookService` Removed `P2PDataStorage.ByteArray hashOfPayload`
   parameter from `OfferBookChangedListener` listener methods
  `onAdded` & `onRemoved`.  (Hash is cached in `OfferPayload`.)

- `P2PDataStorage` Added null check to `ByteArray` class constructor.

- `OfferBook` Adjusted for change to `OfferBookChangedListener`.
   Also removed redundant payload hash null checks.

- `TakeOfferDataModel` and `MarketAlerts` Adjusted for change to
  `OfferBookChangedListener`.

- `OfferBookListItem` Removed overloaded constructor with
  `@Nullable P2PDataStorage.ByteArray hashOfPayload` parameter.
   (Field value is set from cached offer payload hash.)

- `OfferBookViewModelTest` and `OfferMaker`  Adjusted test and test fixture:
   do not attempt to create offer payloads without an `offerFeePaymentTxId`.
2021-09-01 15:48:35 -03:00
Christoph Atteneder
839175b27c
Resynced from last release and synced again 2021-08-27 20:02:14 +02:00
Christoph Atteneder
ce0b301cf1
Update data stores for v1.7.3 2021-08-27 09:30:43 +02:00
Christoph Atteneder
b92d1c25ac
Update data stores for v1.7.2 2021-07-19 20:06:02 +02:00
chimp1984
f169d845d4
Comment out trace logs
In profiler the printMap method got invoked (though it should
not if added as parameter in log)
2021-07-07 22:49:40 +02:00
Christoph Atteneder
d9b84e2a84
Update data stores for v1.7.0 2021-06-25 16:18:10 +02:00
sqrrm
8bc60d0909
Merge pull request #5573 from ripcurlx/add-hint-to-upgrade-to-tor-v3
Add hint to upgrade to tor v3
2021-06-23 13:41:03 +02:00
Christoph Atteneder
e9ef413722
Display a tor node address v3 upgrade prompt
whenever the client is in a state to do so without any problems.
2021-06-14 16:10:47 +02:00
jmacxx
cc7346544b
feature to enable user avatars and tags in Disputes 2021-06-08 15:15:52 -05:00
Christoph Atteneder
3be0795eea
Update data stores for v1.6.5 2021-05-25 10:40:45 +02:00
Christoph Atteneder
fa920fc0a1
Update DAO state for v1.6.3 2021-04-29 20:20:49 +02:00
Christoph Atteneder
b5d772bc48
Update data stores for v1.6.3 2021-04-26 11:11:29 +02:00
Christoph Atteneder
d3233bac7a
Update data stores for v1.6.0 2021-03-24 10:53:24 +01:00
Steven Barclay
f21379160b
Merge branch 'release/v1.6.0' into implement-segwit-for-bsq 2021-03-20 23:18:49 +00:00
jmacxx
f936210717
fix mailbox bootstrap issue 2021-03-02 14:34:03 -06:00
jmacxx
b3263be5e9
Fix initialization ordering issue
TradeManager must be inited before MailboxMessageService
2021-02-24 09:13:52 +01:00
Christoph Atteneder
a691b26de4
Update witness stores 2021-02-23 11:16:29 +01:00
Christoph Atteneder
8e78cfa2b7
Update data stores for v1.5.7 2021-02-22 15:52:18 +01:00
chimp1984
3c38fd67eb
Remove boolean return value for requestPreliminaryData
and call onNoSeedNodeAvailable instead.
2021-02-19 10:09:05 +01:00
chimp1984
f73408a79e
Call onNoSeedNodeAvailable if return value from requestPreliminaryData is false
We did not do all the calls before (like on p2pDataStorage), so that changes behaviour.
2021-02-19 10:09:05 +01:00
chimp1984
e57c26ecb0
Refactor: Extract method from duplicated code 2021-02-19 10:09:05 +01:00
chimp1984
1e6744ddc0
Use same behaviour in onNoSeedNodeAvailable as in onUpdatedDataReceived 2021-02-19 10:09:04 +01:00
chimp1984
45e4aaa24d
Refactor: Rename onBootstrapComplete to onBootstrapped 2021-02-19 10:09:04 +01:00
chimp1984
c6868f1bed
Call p2PDataStorage.onBootstrapComplete() before
mailboxMessageService.onBootstrapped(); and onUpdatedDataReceived

mailboxMessageService depends on p2PDataStorage so we make sure the
p2PDataStorage is updated before we update the mailboxMessageService state.
2021-02-19 10:09:04 +01:00
chimp1984
49e9f72d6e
Merge onUpdatedDataReceived and onNoSeedNodeAvailable to onBootstrapped 2021-02-19 10:09:04 +01:00
chimp1984
44fcfb86bb
Call onNoSeedNodeAvailable on mailboxMessageService at onNoSeedNodeAvailable 2021-02-19 10:09:04 +01:00
chimp1984
d39cdaa33e
Fixes https://github.com/bisq-network/bisq/issues/5204
Remove SetupListener implementation from MailboxMessageService.
Remove requestDataManager
Add onNoSeedNodeAvailable method
Call onNoSeedNodeAvailable from P2PService
2021-02-19 10:09:03 +01:00
chimp1984
fcaad5580b
Use readableFileSize instead of division by 1024 for kb display in statistic logs 2021-02-18 11:40:10 -05:00
Steven Barclay
b4ad6bf637
Upgrade jsonrpc4j & Jackson; simplify BitcoindClient
Change jsonrpc4j version from 1.5.3 to 1.6.0.bisq.1, forked to the Bisq
repo from the recent 1.6.0 release. The forked version changes the class
'com.googlecode.jsonrpc4j.HttpException' to be public, instead of (prob.
mistakenly) package private, so we can avoid using reflection to catch
it and re-throw as a 'bisq.network.http.HttpException'. Remove the now
unused constructors from the latter.

As part of this, upgrade Jackson to the latest stable (2.12.1) release,
since jsonrpc4j now depends on a newer version than the previous 2.8.10.
2021-02-04 07:51:38 +00:00
chimp1984
9041bf4938
onUpdatedDataReceived must be called in the correct order.
We cannot use a listener at RequestDataManager as the order
is not defined if doing so.
So we use P2PService as our controlling entity to call
further clients in the correct order.
2021-01-31 19:38:46 +01:00
Christoph Atteneder
60fc17be2c
Update data stores for v1.5.5 2021-01-25 14:18:21 +01:00
Steven Barclay
f34231abb6
Factor out failure callback logic into new Utilities method 2021-01-21 10:08:23 +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