Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Wallet history #484

Merged
merged 3 commits into from Apr 22, 2016
Merged

Wallet history #484

merged 3 commits into from Apr 22, 2016

Conversation

chris-belcher
Copy link
Collaborator

Implementation of #200

You need to be configured to use Bitcoin Core (-txindex=1 not required), run it with:

python wallet-tool.py wallet.json history

Prints a summary for every transaction. If you have numpy/scipy installed it also calculates the effective interest rate you achieved as if yield-generators were a savings account. For my own yield generator wallet the figure is 0.67% per annum

It checks if the amount of bitcoins in the wallet is the same as the resulting amount when added up as iterating through all transactions. It also checks if the number of UTXOs in the wallet match the number found by iterating through transactions. Both these checks fail for me, and I can't figure out why.

You can create a csv file for opening with spreadsheet software too:

python wallet-tool.py --csv wallet.json history >> history.csv

@AdamISZ
Copy link
Member

AdamISZ commented Mar 26, 2016

Appears to be well-isolated, can't see any impact here, so utACK.

@AdamISZ
Copy link
Member

AdamISZ commented Mar 26, 2016

Quick record of test result as discussed on IRC:

Csv data was created OK.

It checks if the amount of bitcoins in the wallet is the same as the resulting amount when added up as iterating through all transactions. It also checks if the number of UTXOs in the wallet match the number found by iterating through transactions. Both these checks fail for me, and I can't figure out why.

Same here, these checks failed.
Additional vague anecdotal: the number of "cj withdraw" looks too high (I see 21, expect < 15), the number of "deposit" also (see 14 but probably around 10). Sorry for vagueness, memory not good enough.

getblockheader was not found running Bitcoin Core 0.11.2, had to use getblock instead. So presumably either account for this (including the intersection with pruning) or mention somewhere that 0.12 is required (unfortunately not yet recorded here).

@chris-belcher
Copy link
Collaborator Author

Edited to fall back to getblock if getblockheader doesn't exist.

I checked my cj withdraw transactions very carefully to find some error but everything seemed to work. Although it sounds like waxwing's problem is too many withdraws rather than incorrectly the calculated balance.

@chris-belcher
Copy link
Collaborator Author

grubles from IRC tried this (and got 3.2% as an effective interest rate) but didn't get any of the errors. He only deposited coins into the wallet and didnt withdraw, which suggests again it's a problem with cj withdrawal somehow.

@chris-belcher
Copy link
Collaborator Author

An idea for finding the bug, for me the UTXO count from history is higher than the wallet UTXO count. So history believes there are extra UTXOs which dont actually exist. So if I compare the two UTXO sets and find their difference it should give me some clues to what went wrong.

@chris-belcher
Copy link
Collaborator Author

Used the above idea to find and fix the bug.
Turns out some transactions are in walletname="", in my case I had exported a privatekey and spent the UTXO entirely to some other address. This didnt appear with the label "joinmarket-wallet-whatever".

Seems to work now. Please, everybody try this.

@AdamISZ
Copy link
Member

AdamISZ commented Apr 19, 2016

Works correctly for me, feel free to merge.

str(r * 100) + ' %')
print('(as if yield generator was a bank account)')
except ImportError:
print('numpy/scipy not installed to unable to calculate effective ' +
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spelling mistake here

@chris-belcher
Copy link
Collaborator Author

note to self: must add history to the --help documentation

adlai and others added 3 commits April 21, 2016 19:51
- randomized default behavior!
- increases complexity of input-output correlation!
- estimated taker-side "fee event": 1.5x - 2x
@chris-belcher
Copy link
Collaborator Author

Done everything, ready to merge except for two extra commits that have appeared in this PR. Somehow their hash must've changed because of me doing git rebase

I have half a mind to merge anyway.

@chris-belcher chris-belcher merged commit b2e6bcd into develop Apr 22, 2016
@chris-belcher chris-belcher deleted the wallet-history branch April 23, 2016 17:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants