-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add package wtxmgr to use walletdb interface #190
Conversation
This commit converts the wallet to use the new secure hierarchical deterministic wallet address manager package as well as the walletdb package. The following is an overview of modified functionality: - The wallet must now be created before starting the executable - A new flag --create has been added to create the new wallet using wizard style question and answer prompts - Starting the process without an existing wallet will instruct now display a message to run it with --create - Providing the --create flag with an existing wallet will simply show an error and return
Previously a runtime.GC was being invoked which forced it to release the memory as far as the garbage collector is concerned, but the memory was not released back to the OS immediatley. This modification allows the memory to be released immedately since it won't be needed again until the next wallet unlock.
Needs a rebase onto latest intwaddrmgr and some updates for the btcnet -> btcd/chaincfg package move. |
Rebased on top of |
528d4cf
to
4d3f7e2
Compare
Conflicts: btcwallet.go chain/chain.go wallet.go
These three changes result in the unlinking of all previous txstore history. Instead, I would do it this way:
If done this way, each commit will continue to build (important for bisect) and we still keep all history of how the old txstore package was created by looking at files in the legacy directory (without needing to checkout an older commit). |
I agree with @jrick here. That is how I did the waddrmgr as well. |
Thanks, good idea to preserve history, will follow that. |
8c5662f
to
22a05ff
Compare
I realize this is more of a txstore conversion to wallet db, but one of the changes I want is to remove the block index. We won't have this information available when wallet gains SPV support, but txstore/wtxmgr relies on it for correctness (as a lookup key). We should either bite the bullet and rip it out now, or do it in a db upgrade later. |
In no particular order:
I'll continue with the review later but those are some things to get you started on. |
Thanks for the detailed points, will work on those and keep them in mind for future. |
I agree with all of @jrick's points save the stringer. I do agree that in general using go generate is nice, but that particular tool generates code that I don't consider anywhere near the quality it needs to be. It doesn't follow Go standards at all, and as a result, causes tools like golint to fail. As long as that remains the case, I don't want code from stringer anywhere near our repos. |
6cb4a5e
to
1bb5f96
Compare
* remove unnecessary if err := fn(); err != nil branches * use n+1, n-1 in arg instead of n++, n-- * handle index out of range due to invalid metadata * remove unncessary shaHashToBytes * format err message for deserializeOutPoint * remove unreachable code in fetchNumBlockTxRecords * Return nil in place of empty array on err
* update wtxmgr doc.go for txstore to wtxmgr migration
* remove unnecessary valid pointer funcs * simplify bool serialization
* define serialize funcs before deserialize - outpoint, block * pass in object ptrs for deserialize funcs - outpoint, block
* order all serialize/deserialize funcs
* style change - func declarations * txrecord - return out ptr on deserialize
* formatting, %s for err message
@jrick Updated as per yesterday's discussion i.e. buffer reuse + object reuse, docs and style. Also started with benchmarks for serialization which might be useful soon. |
NOTE: This pull request requires #147
Moved
txstore
tolegacy
and added packagewtxmgr
which provideswalletdb
support.Legacy
txstore
will be imported as a part of the wallet setup as implemented in #147.