Parse incoming and announce outgoing fidelity bond messages
Fidelity bond proof messages will be checked and added to the internal
database just like offers. Such messages are not announced in public
but only directly to takers who ask for them, this is because the
signature proofs must commmit to the maker's and taker's IRC nicknames
in order to avoid replay attacks.
The default minfeerate in payjoin is 1.1 sat/vbyte,
however the randomization of 20% for all transactions
created with direct_send means that the previous value
of 1.3 could fall to below 1.1 probabilistically, it
is therefore bumped to a value that never falls below
1.1 after randomization.
912b4d5140 add missing whitespace to log (unofficial bisq contributor)
Pull request description:
Beforehand, nick string was appended with `totalin=`
ACKs for top commit:
kristapsk:
utACK 912b4d5140
Tree-SHA512: e93e7d6420584ba58f7f789fe866bc1d448e7c9205c9673eff3aa2be2a3e96cd4c2dd183a76480301ca16ff03e85d2c2bce3c1682a431c2fc7a51d9b06fc9cdf
f361c98dba Better handling of non-standard tx'es, less extra output for csv and other small improvements (Kristaps Kaupe)
Pull request description:
* Better handle non-standard (in JM context) transactions and try normal output also for "unknown". Fixes#839.
* Fully handles non-standard internal transactions, where all outputs go to JM wallet (previously didn't work if there was more than two outputs to our wallet).
* Rename "unknown type" to "unknown", for better alignment.
* Don't output summary and line about increasing verbosity for CSV, it makes it more valid CSV (only extra output now is "User data location: ..." line, but that's easy to filter out, as it is the first line).
* Output absolute value for "amount/btc" column. Improves alignment, and sign is already present in next "balance-change/btc" column.
Example below.
Testnet wallet with some manually crafted transactions (used Electrum to create them, all inputs and outputs were from / to same wallet), before:
```
tx# timestamp type amount/btc balance-change/btc balance/btc coinjoin-n total-fees utxo-count mixdepth-from mixdepth-to
" 0" "2021-06-04 20:07" "deposit " "0.00500000" "+0.00500000" "0.00500000" " #" "N/A " " 1" " #" " 0"
our utxos: 1 in, 3 out
this is wrong TODO handle non-coinjoin internal
"N= 1" "2021-06-04 21:41" "cj batch " "0.00100000" "-0.00000200" "0.00499800" "1.0" "N/A " " 4" " 0" " 0"
2021-06-05 07:58 best block is 000000000000003806d395c49ffadda52a07f2583e8e978f2a01b0d4f7e5e009
total profit = -0.00000200 BTC
continuously compounded equivalent annual interest rate = -29.57414924985335 %
(as if yield generator was a bank account)
BUG ERROR: wallet balance (0.00499600) does not match balance from history (0.00499800)
```
After:
```
tx# timestamp type amount/btc balance-change/btc balance/btc coinjoin-n total-fees utxo-count mixdepth-from mixdepth-to
" 0" "2021-06-04 20:07" "deposit " "0.00500000" "+0.00500000" "0.00500000" " #" "N/A " " 1" " #" " 0"
" 1" "2021-06-04 20:16" "internal " "0.00499800" "-0.00000200" "0.00499800" " 2" "N/A " " 3" " 0" " 0"
" 2" "2021-06-04 21:41" "internal " "0.00499400" "-0.00000200" "0.00499600" " 1" "N/A " " 4" " 0" " 0"
2021-06-05 08:38 best block is 0000000000000017ded6660eccf9fe57a05e9c5e397fd1c4df1e9e8b09e2dda1
total profit = 0.00000000 BTC
```
Top commit has no ACKs.
Tree-SHA512: db28c212fd24943178ae8540c3e1c48eebecc5a40fda278f08e6b79e3b23f7aec891c6e5387dff6476818799a1a5614cef5d8425a55704e8f9d76929c3f91ad1
Before this commit, if the sender specified
the additionalfeeoutputindex as 0, the receiver
incorrectly treated this as meaning it could not
decrement the change value at all (treating zero
as false in Python `if`), meaning that the feerate
was reduced more than intended, or in extreme
cases, the payjoin fell back incorrectly because
the feerate fell below the specified minfeerate.
After this commit, the additionalfeeoutputindex
value specified by the sender is correctly used
by the receiver in all cases.
Fixes#889.
Prior to this commit, it was possible for the
yg-privacyenhanced.py script to go into an infinite
loop of attempting to halve the txfee setting, in case
the user selected (a) reloffer, (b) an absurdly low
minsize like 1 sat, and (c) a txfee of zero.
This occurred partially due to the randomization of minsizes
included in the yg-pe algorithm, which could lead to a
pathological zero value for minsize.
After this commit the minsize is automatically bumped to
the `DUST_THRESHOLD` value if it falls below it, preventing
the possibility of a nonsensical value.
Additionally, the loop which halves the txfee is no longer
allowed to continue beyond 20 iterations, as an extra sanity
check.
4599bd75a8 Fix autofreeze warning on Qt (Adam Gibson)
Pull request description:
The autofreeze utxo callback takes a `utxo` as argument, not a utxo string, so convert here in `joinmarket-qt.py`, just as in `WalletService.default_autofreeze_callback`.
ACKs for top commit:
kristapsk:
ACK 4599bd75a8, tested before / after, merging.
Tree-SHA512: ddb13cc98bd6a116636a8e863f93696537402be71de17e169152537425b28cdb062288b442489e03f02fbcd76134269b33e49495078fff7c206f9c12543b91c2
The above commit added custom change addresses, however it
introduced a bug for multiple transaction schedules on the same
Taker object, as happens with tumbler for example: a new
change address would not be created for new transactions.
This commit fixes that and ensures a new change address is always
chosen when a custom change address was not specified for the
Taker object instantiation (which is always the case for tumbler).
This removes any reference to the `key-type` parameter on the
`importprivkey` wallet command from the code and from the help output.
This parameter was already effectively being ignored, the key type would
always default to the key type of the wallet. This brings the help info
and the code comments in line with the existing functionality.
79493749d9 Clear single send form after successful send (Kristaps Kaupe)
Pull request description:
Helps to avoid accidental sending twice to the same recipient and also clears fields for the user who needed to do it manually if doing more than one send in a single JoinMarketQt session.
Top commit has no ACKs.
Tree-SHA512: 1f79663d1d24718d038972d3b5d670f1a00f038b5169a627c82657154b3587c515b7c9fe99924208dc21e32ddb2e38d0cb8bab54cbe359585e0e459d94f5bbfc
Fixes#797.
Adds `custom_change_addr` argument to `direct_send()`
joinmarket-qt: Adds input field for optional external change address
joinmarket-qt: Better handle PayJoin/CoinJoin state changes for changeInput widget
Adds `custom_change_address` argument to Taker constructor and use it in joinmarket-qt
Custom change also allowed in sendpayment CLI with `-u` flag (not
supported in tumbler).
Explicitly disallows using custom change with BIP78 Payjoin, though that
could change later.
Both sendpayment and CLI provide detailed warnings to avoid misuse. In
particular, they have an extra warning for using a nonstandard or
non-wallet scriptpubkey type.
Setting custom change to the recipient address is explicitly forbidden.
Tests: Adds custom_change usage test in test_taker.
79bb3ff5b3 Allow to specify all conftest.py arguments to run_tests.sh (Kristaps Kaupe)
Pull request description:
Without this `test/run_tests.sh` can't be used if Bitcoin binaries aren't on `PATH` (that was the problem @csH7KmCC9 was having in #859 discussion).
There is some ugly copypasting in `parse_flags()`, but, as this is only testing script, I don't want to spend time to make it nicer right now.
Top commit has no ACKs.
Tree-SHA512: 8a085d6b1e19db8546b68393129ee235830ed5633ad41dc886b04e8529ecf434a020770ca799c8f7db7403b6e6162d2c56a1fd3b86506ed4d8ea079885403e33