funding: use default routing policy when advertising initial channel routing policy
This commit is contained in:
parent
89537318c1
commit
b47ffde4ad
@ -13,6 +13,7 @@ import (
|
|||||||
"github.com/go-errors/errors"
|
"github.com/go-errors/errors"
|
||||||
"github.com/lightningnetwork/lnd/chainntnfs"
|
"github.com/lightningnetwork/lnd/chainntnfs"
|
||||||
"github.com/lightningnetwork/lnd/channeldb"
|
"github.com/lightningnetwork/lnd/channeldb"
|
||||||
|
"github.com/lightningnetwork/lnd/htlcswitch"
|
||||||
"github.com/lightningnetwork/lnd/lnrpc"
|
"github.com/lightningnetwork/lnd/lnrpc"
|
||||||
"github.com/lightningnetwork/lnd/lnwallet"
|
"github.com/lightningnetwork/lnd/lnwallet"
|
||||||
"github.com/lightningnetwork/lnd/lnwire"
|
"github.com/lightningnetwork/lnd/lnwire"
|
||||||
@ -172,6 +173,10 @@ type fundingConfig struct {
|
|||||||
// TempChanIDSeed is a cryptographically random string of bytes that's
|
// TempChanIDSeed is a cryptographically random string of bytes that's
|
||||||
// used as a seed to generate pending channel ID's.
|
// used as a seed to generate pending channel ID's.
|
||||||
TempChanIDSeed [32]byte
|
TempChanIDSeed [32]byte
|
||||||
|
|
||||||
|
// DefaultRoutingPolicy is the default routing policy used when
|
||||||
|
// initially announcing channels.
|
||||||
|
DefaultRoutingPolicy htlcswitch.ForwardingPolicy
|
||||||
}
|
}
|
||||||
|
|
||||||
// fundingManager acts as an orchestrator/bridge between the wallet's
|
// fundingManager acts as an orchestrator/bridge between the wallet's
|
||||||
@ -1158,15 +1163,14 @@ func (f *fundingManager) newChanAnnouncement(localPubKey, remotePubKey *btcec.Pu
|
|||||||
chanFlags = 1
|
chanFlags = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(roasbeef): populate proper FeeSchema
|
|
||||||
chanUpdateAnn := &lnwire.ChannelUpdate{
|
chanUpdateAnn := &lnwire.ChannelUpdate{
|
||||||
ShortChannelID: shortChanID,
|
ShortChannelID: shortChanID,
|
||||||
Timestamp: uint32(time.Now().Unix()),
|
Timestamp: uint32(time.Now().Unix()),
|
||||||
Flags: chanFlags,
|
Flags: chanFlags,
|
||||||
TimeLockDelta: 1,
|
TimeLockDelta: uint16(f.cfg.DefaultRoutingPolicy.TimeLockDelta),
|
||||||
HtlcMinimumMsat: 0,
|
HtlcMinimumMsat: uint64(f.cfg.DefaultRoutingPolicy.MinHTLC),
|
||||||
FeeBaseMsat: 0,
|
BaseFee: uint32(f.cfg.DefaultRoutingPolicy.BaseFee),
|
||||||
FeeProportionalMillionths: 0,
|
FeeRate: uint32(f.cfg.DefaultRoutingPolicy.FeeRate),
|
||||||
}
|
}
|
||||||
|
|
||||||
// With the channel update announcement constructed, we'll generate a
|
// With the channel update announcement constructed, we'll generate a
|
||||||
|
1
lnd.go
1
lnd.go
@ -152,6 +152,7 @@ func lndMain() error {
|
|||||||
|
|
||||||
return nil, fmt.Errorf("unable to find channel")
|
return nil, fmt.Errorf("unable to find channel")
|
||||||
},
|
},
|
||||||
|
DefaultRoutingPolicy: activeChainControl.routingPolicy,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user