mirror of
https://github.com/guggero/chantools.git
synced 2026-08-13 12:33:34 +02:00
Merge pull request #206 from ziggie1984/fix-forceclose-trigger
fix triggerforceclose cmd
This commit is contained in:
commit
2b59a56ee2
1 changed files with 29 additions and 13 deletions
|
|
@ -20,6 +20,7 @@ import (
|
|||
"github.com/lightningnetwork/lnd/discovery"
|
||||
"github.com/lightningnetwork/lnd/feature"
|
||||
"github.com/lightningnetwork/lnd/fn/v2"
|
||||
graphdb "github.com/lightningnetwork/lnd/graph/db"
|
||||
"github.com/lightningnetwork/lnd/graph/db/models"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||
"github.com/lightningnetwork/lnd/htlcswitch/hodl"
|
||||
|
|
@ -128,6 +129,17 @@ func ConnectPeer(conn *brontide.Conn, connReq *connmgr.ConnReq,
|
|||
return nil, nil, err
|
||||
}
|
||||
|
||||
graphDB, err := graphdb.NewChannelGraph(&graphdb.Config{
|
||||
KVDB: backend,
|
||||
})
|
||||
if err != nil {
|
||||
_ = backend.Close()
|
||||
_ = channelDB.Close()
|
||||
|
||||
return nil, nil, fmt.Errorf("unable to open graph db: %w",
|
||||
err)
|
||||
}
|
||||
|
||||
gossiper := discovery.New(discovery.Config{
|
||||
ChainHash: *netParams.GenesisHash,
|
||||
Broadcast: func(_ map[route.Vertex]struct{},
|
||||
|
|
@ -188,20 +200,24 @@ func ConnectPeer(conn *brontide.Conn, connReq *connmgr.ConnReq,
|
|||
PubKey: identityECDH.PubKey(),
|
||||
})
|
||||
|
||||
chanStatusMgr, err := netann.NewChanStatusManager(&netann.
|
||||
ChanStatusConfig{
|
||||
ChanStatusSampleInterval: 30 * time.Second,
|
||||
ChanDisableTimeout: 2 * time.Minute,
|
||||
DB: channelDB.ChannelStateDB(),
|
||||
IsChannelActive: func(lnwire.ChannelID) bool {
|
||||
return true
|
||||
},
|
||||
ApplyChannelUpdate: func(*lnwire.ChannelUpdate1,
|
||||
*wire.OutPoint, bool) error {
|
||||
chanStatusMgr, err := netann.NewChanStatusManager(
|
||||
&netann.ChanStatusConfig{
|
||||
ChanStatusSampleInterval: 30 * time.Second,
|
||||
// Enable + Sample Interval must be <= DisableTimeout.
|
||||
ChanEnableTimeout: 30 * time.Second,
|
||||
ChanDisableTimeout: 2 * time.Minute,
|
||||
DB: channelDB.ChannelStateDB(),
|
||||
Graph: graphDB,
|
||||
OurPubKey: identityECDH.PubKey(),
|
||||
IsChannelActive: func(lnwire.ChannelID) bool {
|
||||
return true
|
||||
},
|
||||
ApplyChannelUpdate: func(*lnwire.ChannelUpdate1,
|
||||
*wire.OutPoint, bool) error {
|
||||
|
||||
return nil
|
||||
},
|
||||
})
|
||||
return nil
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
_ = channelDB.Close()
|
||||
return nil, nil, fmt.Errorf("unable to create channel status "+
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue