Browse Source
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
master
1 changed files with 26 additions and 13 deletions
Loading…
Reference in new issue