htlcswitch+config: make circular forwarding defence configurable
Add a bool to the switch's config which can be used to disable same channel circular route checks.
This commit is contained in:
parent
a3478f1d99
commit
afc7cc7f84
@ -341,6 +341,8 @@ type config struct {
|
||||
Watchtower *lncfg.Watchtower `group:"watchtower" namespace:"watchtower"`
|
||||
|
||||
LegacyProtocol *lncfg.LegacyProtocol `group:"legacyprotocol" namespace:"legacyprotocol"`
|
||||
|
||||
AllowCircularRoute bool `long:"allow-circular-route" description:"If true, our node will allow htlc forwards that arrive and depart on the same channel."`
|
||||
}
|
||||
|
||||
// loadConfig initializes and parses the config using a config file and command
|
||||
|
@ -470,6 +470,7 @@ func newServer(listenAddrs []net.Addr, chanDB *channeldb.DB,
|
||||
FwdEventTicker: ticker.New(htlcswitch.DefaultFwdEventInterval),
|
||||
LogEventTicker: ticker.New(htlcswitch.DefaultLogInterval),
|
||||
AckEventTicker: ticker.New(htlcswitch.DefaultAckInterval),
|
||||
AllowCircularRoute: cfg.AllowCircularRoute,
|
||||
RejectHTLC: cfg.RejectHTLC,
|
||||
}, uint32(currentHeight))
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user