waddrmgr: add new DerivationInfo method to ManagedPubKeyAddress

In this commit, we add a new method DerivationInfo to the
ManagedPubKeyAddress interface. This method is meant to provide callers
with the information necessary to independently derive each key returned
by the various methods provided to derive addresses.
This commit is contained in:
Olaoluwa Osuntokun 2018-08-13 18:41:24 -07:00
parent 1ede0a1a66
commit 05d73f6899

View file

@ -103,6 +103,12 @@ type ManagedPubKeyAddress interface {
// ExportPrivKey returns the private key associated with the address // ExportPrivKey returns the private key associated with the address
// serialized as Wallet Import Format (WIF). // serialized as Wallet Import Format (WIF).
ExportPrivKey() (*btcutil.WIF, error) ExportPrivKey() (*btcutil.WIF, error)
// DerivationInfo contains the information required to derive the key
// that backs the address via traditional methods from the HD root. For
// imported keys, the first value will be set to false to indicate that
// we don't know exactly how the key was derived.
DerivationInfo() (bool, KeyScope, DerivationPath)
} }
// ManagedScriptAddress extends ManagedAddress and represents a pay-to-script-hash // ManagedScriptAddress extends ManagedAddress and represents a pay-to-script-hash