mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-12-08 20:03:10 +01:00
multi: use key locator for lnwallet.MessageSigner
To simplify the message signing API even further, we refactor the lnwallet.MessageSigner interface to use a key locator instead of the public key to identify which key should be signed with.
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"github.com/btcsuite/btcd/btcec"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightningnetwork/lnd/channeldb"
|
||||
"github.com/lightningnetwork/lnd/keychain"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"github.com/lightningnetwork/lnd/lnwire"
|
||||
)
|
||||
@@ -43,6 +44,10 @@ type ChanStatusConfig struct {
|
||||
// OurPubKey is the public key identifying this node on the network.
|
||||
OurPubKey *btcec.PublicKey
|
||||
|
||||
// OurKeyLoc is the locator for the public key identifying this node on
|
||||
// the network.
|
||||
OurKeyLoc keychain.KeyLocator
|
||||
|
||||
// MessageSigner signs messages that validate under OurPubKey.
|
||||
MessageSigner lnwallet.MessageSigner
|
||||
|
||||
@@ -621,7 +626,7 @@ func (m *ChanStatusManager) signAndSendNextUpdate(outpoint wire.OutPoint,
|
||||
}
|
||||
|
||||
err = SignChannelUpdate(
|
||||
m.cfg.MessageSigner, m.cfg.OurPubKey, chanUpdate,
|
||||
m.cfg.MessageSigner, m.cfg.OurKeyLoc, chanUpdate,
|
||||
ChanUpdSetDisable(disabled), ChanUpdSetTimestamp,
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user