mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-22 22:25:24 +01:00
lnwallet: add new PreimageCache interface
This commit is contained in:
parent
a9d451e46d
commit
b1503adfad
1 changed files with 16 additions and 2 deletions
|
@ -278,13 +278,27 @@ type MessageSigner interface {
|
|||
SignMessage(pubKey *btcec.PublicKey, msg []byte) (*btcec.Signature, error)
|
||||
}
|
||||
|
||||
// PreimageCache is an interface that represents a global cache for preimages.
|
||||
// We'll utilize this cache to communicate the discovery of new preimages
|
||||
// across sub-systems.
|
||||
type PreimageCache interface {
|
||||
// LookupPreimage attempts to look up a preimage according to its hash.
|
||||
// If found, the preimage is returned along with true for the second
|
||||
// argument. Otherwise, it'll return false.
|
||||
LookupPreimage(hash []byte) ([]byte, bool)
|
||||
|
||||
// AddPreimage attempts to add a new preimage to the global cache. If
|
||||
// successful a nil error will be returned.
|
||||
AddPreimage(preimage []byte) error
|
||||
}
|
||||
|
||||
// WalletDriver represents a "driver" for a particular concrete
|
||||
// WalletController implementation. A driver is identified by a globally unique
|
||||
// string identifier along with a 'New()' method which is responsible for
|
||||
// initializing a particular WalletController concrete implementation.
|
||||
type WalletDriver struct {
|
||||
// WalletType is a string which uniquely identifies the WalletController
|
||||
// that this driver, drives.
|
||||
// WalletType is a string which uniquely identifies the
|
||||
// WalletController that this driver, drives.
|
||||
WalletType string
|
||||
|
||||
// New creates a new instance of a concrete WalletController
|
||||
|
|
Loading…
Add table
Reference in a new issue