Import external watch-only addresses
Added RPC commands to import external watch-only addresses both with and without pubkeys. WIP on finishing test coverage and docs.
Refs #192
Since the format of existing addresses in the db is being changed here, the db version needs to be bumped and it needs upgrade code to handle the new serialization. You should be able to do it without requiring the private passphrase by specifically targetting the new field offset.
Yeah, we will need a upgrade to initialize the watchingOnly field, I guess it can be inferred by checking that pubkey is not nil.
@davecgh Added upgrade path, addressed items reviewed above. Tested that we support importing pubkeys, p2pkh and p2sh addresses now.
Addressed all the review items above except the upgrade re-serialization, will be done with that in a bit.
@davecgh Done with the re-serialization bit. Added docs to make it readable. Please review.
Needs tests with the version upgrades test setup in #237
This needs a rebase over latest master. Could you also squash all of the fixes (all commits after 43f8801) into a single commit?
OK, updated PubKey to return compressed as well as ok. Refactored related methods accordingly.
The changed methods need better documentation to describe what all the return values are. Either the interface definition can use named returns to document the values, or comments should be added to describe what each bool means.
Thanks, using named returns in the interface and also updated docs about the return values.
What's the status on this? The corresponding PRs btcsuite/btcd#279 and btcsuite/btcjson#41 were merged a long time ago.
Did btcsuite/btcwallet#192 "supersede" this PR?
There are several conflicts preventing this from being merged. There will be even more conflicts if decred/dcrwallet#315 is backported to btcwallet.
We're also moving away from the idea of importing keys into a HD wallet, both to simplify our code and to make the entire wallet recoverable from just the seed. Would need a discussion about if we still even want this feature.