Commit Graph

16028 Commits

Author SHA1 Message Date
chimp1984
747916ac2f
Fixes https://github.com/bisq-network/bisq/issues/5882
When syncing from genesis the number of blocks are limited so we get the
`onParseBlockCompleteAfterBatchProcessing` called each time when the received
 blocks are processed, and as we are not at wallet height we repeat requesting
 blocks. But the new check for the BTC recipient triggers a resync from resource call.
We add now a check that we do this check only once the wallet is synced and our
block height from dao state matches wallet blockheight.
2021-12-03 20:09:47 -05:00
chimp1984
c9e0265e13
Fix handling for genesis height and case when wallet sync is not completed yet.
- At genesis we use the genesis height for request (not height+1)
- If wallet is not synced yet we do not call onParseBlockChainComplete (as it was before)
2021-12-03 19:48:17 -05:00
ghubstan
98b41cb56c
Use string in BigDecimal ctor, and make codacy happy too 2021-12-03 13:33:20 -03:00
ghubstan
5f7fd6257b
Merge branch 'master' into 6-api-xmr-trading 2021-12-03 13:19:24 -03:00
ghubstan
0f32fe2fc3
Merge branch '5-api-bsqswap-simulation-n-docs-update' into 6-api-xmr-trading 2021-12-03 13:16:26 -03:00
ghubstan
f195b76637
Tell user bsqswap offer cannot be edited, but can be canceled at no charge
Resolves issue described in https://github.com/bisq-network/bisq/pull/5876#pullrequestreview-822692137
2021-12-03 12:47:03 -03:00
ghubstan
bb68605c69
Add missing --currency-code=bsq param to createoffer example
Resolves issue mentioned in https://github.com/bisq-network/bisq/pull/5876#pullrequestreview-822692137
2021-12-03 12:13:33 -03:00
Nutel
07ec6ec0d0
Fixed annoying semicolon colors.
That line is just command output, not a sh command.
2021-12-03 15:36:00 +01:00
Christoph Atteneder
ccda66d2c6
Improve warning when BSQ swap offer is removed 2021-12-03 12:21:03 +01:00
Christoph Atteneder
daf762f8fa
Add visual icon for duplicate offer functionality 2021-12-03 12:02:10 +01:00
Christoph Atteneder
6a384a7914
Add support to duplicate bsq swap offers also in History view 2021-12-03 11:25:24 +01:00
Christoph Atteneder
b9fa9d6347
Merge pull request #5888 from jmacxx/fix_npe_portfolio_history
Fix NPEs in Portfolio View wrt. BSQ swap
2021-12-03 10:47:10 +01:00
jmacxx
fc2bb6c8b9
Fix NPEs in Portfolio View wrt. BSQ swap 2021-12-03 10:33:25 +01:00
ghubstan
104f11acaa
Do not run 2x from gradle terminal cmd
Method tests are combined in scenario pkg tests to reduce test
harness startup/shutdown time.
2021-12-02 19:50:18 -03:00
ghubstan
e2647af6b5
Add a few more checks on editedOffer.getUseMarketBasedPrice() 2021-12-02 19:40:58 -03:00
ghubstan
f867f6beb3
Add new regtest apitest/scripts/trade-xmr-simulation.sh 2021-12-02 19:18:24 -03:00
ghubstan
65fb8e8225
Add CliMain.main(args) tests
There are no asserts, but helpful for looking at affects of CLI commands
from terminal because apitest cases use gRPC service stubs instead of terminal.
2021-12-02 19:17:03 -03:00
ghubstan
743ef93750
Test API XMR support 2021-12-02 19:11:29 -03:00
ghubstan
a45c5fa61f
Adjust CLI opts parsers & opt parsing test for XMR support 2021-12-02 19:09:54 -03:00
ghubstan
03b57916a5
Make altcoin offer sorting method names more generic 2021-12-02 19:07:49 -03:00
ghubstan
54f815eb4f
Adjust API cli-side CryptoCurrencyUtil & OffersServiceRequest for XMR support 2021-12-02 19:04:28 -03:00
ghubstan
742a6f441e
Allow mkt price lookup for any altcoin from API 2021-12-02 19:02:03 -03:00
ghubstan
ce8b6df9c5
Adjust API CorePaymentAccountsService for creating XMR accts 2021-12-02 19:00:22 -03:00
jmacxx
715c502c35
Fix NPEs in Portfolio View wrt. BSQ swap 2021-12-02 13:13:40 -06:00
Steven Barclay
0517facbc3
Validate input script types to prevent BSQ swap tx fee underpaying
Add a check of 'scriptTypeId' field, against the output of the spending
tx, to the 'RawTransactionInput::validate' method. Also make the seller
as well as the buyer validate each raw BSQ/BTC input received from the
peer. This prevents either peer from claiming that any of their
non-segwit inputs are segwit in order to underpay the tx fee.
2021-12-02 18:25:53 +00:00
ghubstan
b85459d7c6
Refactor api.core side editoffer validation & fix bug
The editoffer validation bug fixes:

- A trigger-price edit forced offer.price-margin=0.00.

	This needs to be checked in new apitest case asserts.

- An activate state (only) edit forced offer.isUseMarketBasedPrice=true.

	The CLI does not have the offer instance, and cannot know the correct
	value of the isUseMarketBasedPrice param sent in the editoffer request.
	The daemon has to figure this out.  If the editType parameter value
	sent to daemon is ACTIVATION_STATE_ONLY, use the current offer.isUseMarketBasedPrice.

The refactoring includes more useful and readable information in core's EditOfferValidator
and MutableOfferPayloadFields toString methods, for debugging with the daemon log. And some
adjustments for allowing edits to XMR offers.
2021-12-02 15:04:38 -03:00
ghubstan
095a49598c
Add more readable toString method to MutableOfferPayloadFields
This makes it easier to compare to EditOfferValidator.toString
2021-12-02 14:51:15 -03:00
Steven Barclay
915a79e627
Fix BSQ swap buyer tx fee theft vulnerability
Prevent the seller from stealing the combined tx fee as change by lying
about the value of one or more of his BTC inputs, which are passed to
the buyer as raw inputs in the 'BsqSwapFinalizeTxRequest' message.

To this end, add a 'RawTransactionInput::validate' method to check the
'value' field against the output value of the respective spending tx and
run it on every seller input in 'ProcessBsqSwapFinalizeTxRequest', so
that the buyer is no longer just trusting those numbers.

Additionally, check that the spending txIds from the raw BTC inputs
supplied by the seller actually match those of his signed inputs in the
accompanying partially signed tx, thus tying the raw input values to the
seller's tx.
2021-12-02 17:19:10 +00:00
Steven Barclay
8d267520c8
Fix misleading comment: BSQ swap taker tx fee tolerance
(Actual tolerance by maker of agreed tx fee is 50%, not 10%.)
2021-12-02 14:54:57 +00:00
Christoph Atteneder
1606439144
Add support to duplicate bsq swap offers 2021-12-02 13:39:11 +01:00
ghubstan
33d976cf79
Calculate offer.makerFee if offer is bsq-swap
V1 offer instances have a makeFee value, but not BSQ swap offers.
This needs to be investigated.
See commit d57d6e9852.
2021-12-01 19:06:01 -03:00
jmacxx
32f057b2ad
Always use fresh address for MULTI_SIG context 2021-12-01 13:27:43 -06:00
ghubstan
e3c40895fe
Use offer instance to determine ownership, not it's id 2021-12-01 16:05:30 -03:00
ghubstan
d57d6e9852
Use calculated offer maker fee, do not re-calculate it 2021-12-01 16:03:31 -03:00
Christoph Atteneder
f224cf7c7c
Add Polish translation 2021-12-01 15:13:57 +01:00
Christoph Atteneder
9aad4d6a40
Merge pull request #5883 from ripcurlx/add-polish-translation
Add Polish translation
2021-12-01 15:13:26 +01:00
Christoph Atteneder
1f2a3234fe
Add Polish translation 2021-12-01 11:35:25 +01:00
MwithM
7f22ffedf9
Substitute Unconfirmed for Processing BSQ swap
**Unconfirmed** BSQ swap seems like something failed. **Processing** is used by some wallets for unconfirmed transactions and has no negative implications.
2021-12-01 11:25:14 +01:00
Christoph Atteneder
4657614c27
Merge pull request #5879 from Emzy/master
make all scripts executable
2021-12-01 10:47:42 +01:00
Steven Barclay
0ee6175fb2
Fix bug in Equihash.IntListMultimap & adjust constants
Fix a trivial bug in the iterator returned by 'IntListMultimap::get',
caused by mistaken use of the iterator index in place of the key when
doing lookups into the overspill map. This was causing puzzle solutions
to be invalid about 3% of the time, as well as substantially reducing
the average number of solutions found per nonce.

As the fix increases the mean solution count per nonce to the correct
value of 2.0 predicted by the paper (regardless of puzzle params k & n),
inline the affected constants to simplify 'Equihash::adjustDifficulty'.
2021-11-30 21:26:17 +00:00
ghubstan
946ca460ef
Merge branch 'master' into 5-api-bsqswap-simulation-n-docs-update 2021-11-30 12:46:34 -03:00
Stephan Oeste
74d87d7695
make all scripts executable
Signed-off-by: Stephan Oeste <emzy@emzy.de>
2021-11-30 12:40:06 +01:00
jmacxx
cb1998db05
Bugfix: dispute ticket reopened by mailbox message 2021-11-30 10:28:11 +01:00
Christoph Atteneder
c4e18fedd9
Merge pull request #5878 from jmacxx/fix_dispute_reopen_issue
Bugfix: dispute ticket reopened by mailbox message
2021-11-30 10:27:52 +01:00
ghubstan
3015554f9a
Adjust API beta-test guide for BSQ swaps 2021-11-29 13:14:56 -03:00
ghubstan
a1db0d10b0
Update API docs for Bitcoin Core version v22.0
Plus some outdated JDK version compat comments.
2021-11-29 12:43:58 -03:00
ghubstan
b1dd20572c
Allow unrecognized options in OfferIdOptionParser where appropriate
The OfferIdOptionParser superclass reduces duplication for parsing
offer-id parameters, but it needs to let subclass parsers' other
options pass validation.
2021-11-29 12:30:13 -03:00
jmacxx
0025609375
Bugfix: dispute ticket reopened by mailbox message 2021-11-29 09:18:55 -06:00
ghubstan
6b89254588
Adjust core api method help docs for bsq swaps 2021-11-29 11:29:42 -03:00
ghubstan
8b2dec7a55
Remove unused function outputs 2021-11-28 16:37:41 -03:00