mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
htlcswitch+server: add new field SelfKey to htlcswitch.Config
This commit adds a new field to the switch’s Config, namely the public key of the backing lightning node. This field will soon be used to return more detailed errors messages back to the ChannelRouter itself.
This commit is contained in:
parent
51d04e8922
commit
61be23dc31
@ -9,6 +9,7 @@ import (
|
|||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
|
|
||||||
"github.com/davecgh/go-spew/spew"
|
"github.com/davecgh/go-spew/spew"
|
||||||
|
"github.com/roasbeef/btcd/btcec"
|
||||||
|
|
||||||
"github.com/go-errors/errors"
|
"github.com/go-errors/errors"
|
||||||
"github.com/lightningnetwork/lnd/lnrpc"
|
"github.com/lightningnetwork/lnd/lnrpc"
|
||||||
@ -85,8 +86,13 @@ type ChanClose struct {
|
|||||||
// Config defines the configuration for the service. ALL elements within the
|
// Config defines the configuration for the service. ALL elements within the
|
||||||
// configuration MUST be non-nil for the service to carry out its duties.
|
// configuration MUST be non-nil for the service to carry out its duties.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
// LocalChannelClose kicks-off the workflow to execute a cooperative
|
// SelfKey is the key of the backing Lightning node. This key is used
|
||||||
// or forced unilateral closure of the channel initiated by a local
|
// to properly craft failure messages, such that the Layer 3 router can
|
||||||
|
// properly route around link./vertex failures.
|
||||||
|
SelfKey *btcec.PublicKey
|
||||||
|
|
||||||
|
// LocalChannelClose kicks-off the workflow to execute a cooperative or
|
||||||
|
// forced unilateral closure of the channel initiated by a local
|
||||||
// subsystem.
|
// subsystem.
|
||||||
LocalChannelClose func(pubKey []byte, request *ChanClose)
|
LocalChannelClose func(pubKey []byte, request *ChanClose)
|
||||||
}
|
}
|
||||||
|
@ -176,6 +176,7 @@ func newServer(listenAddrs []string, chanDB *channeldb.DB, cc *chainControl,
|
|||||||
}
|
}
|
||||||
|
|
||||||
s.htlcSwitch = htlcswitch.New(htlcswitch.Config{
|
s.htlcSwitch = htlcswitch.New(htlcswitch.Config{
|
||||||
|
SelfKey: s.identityPriv.PubKey(),
|
||||||
LocalChannelClose: func(pubKey []byte,
|
LocalChannelClose: func(pubKey []byte,
|
||||||
request *htlcswitch.ChanClose) {
|
request *htlcswitch.ChanClose) {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user