Merge pull request #271 from guggero/lsat-routing-fee

Bump default LSAT max routing fee and make it configurable
This commit is contained in:
Olaoluwa Osuntokun 2021-07-01 16:53:04 -07:00 committed by GitHub
commit 335b44e849
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 16 deletions

View file

@ -137,6 +137,8 @@ type Config struct {
NewNodesOnly bool `long:"newnodesonly" description:"Only accept channels from nodes that the connected lnd node doesn't already have open or pending channels with."`
LsatMaxRoutingFee btcutil.Amount `long:"lsatmaxroutingfee" description:"The maximum amount in satoshis we are willing to pay in routing fees when paying for the one-time LSAT auth token that is required to use the Pool service."`
Profile string `long:"profile" description:"Enable HTTP profiling on given port -- NOTE port must be between 1024 and 65535"`
FakeAuth bool `long:"fakeauth" description:"Disable LSAT authentication and instead use a fake LSAT ID to identify. For testing only, cannot be set on mainnet."`
@ -163,26 +165,27 @@ const (
// is allowed to take to complete.
defaultRPCTimeout = 30 * time.Second
defaultLsatMaxCost = btcutil.Amount(1000)
defaultLsatMaxFee = btcutil.Amount(10)
defaultLsatMaxFee = btcutil.Amount(50)
)
// DefaultConfig returns the default value for the Config struct.
func DefaultConfig() Config {
return Config{
Network: DefaultNetwork,
RPCListen: "localhost:12010",
RESTListen: "localhost:8281",
Insecure: false,
BaseDir: DefaultBaseDir,
LogDir: defaultLogDir,
MaxLogFiles: defaultMaxLogFiles,
MaxLogFileSize: defaultMaxLogFileSize,
MinBackoff: defaultMinBackoff,
MaxBackoff: defaultMaxBackoff,
DebugLevel: defaultLogLevel,
TLSCertPath: DefaultTLSCertPath,
TLSKeyPath: DefaultTLSKeyPath,
MacaroonPath: DefaultMacaroonPath,
Network: DefaultNetwork,
RPCListen: "localhost:12010",
RESTListen: "localhost:8281",
Insecure: false,
BaseDir: DefaultBaseDir,
LogDir: defaultLogDir,
MaxLogFiles: defaultMaxLogFiles,
MaxLogFileSize: defaultMaxLogFileSize,
MinBackoff: defaultMinBackoff,
MaxBackoff: defaultMaxBackoff,
DebugLevel: defaultLogLevel,
TLSCertPath: DefaultTLSCertPath,
TLSKeyPath: DefaultTLSKeyPath,
MacaroonPath: DefaultMacaroonPath,
LsatMaxRoutingFee: defaultLsatMaxFee,
Lnd: &LndConfig{
Host: "localhost:10009",
MacaroonPath: DefaultLndMacaroonPath,

View file

@ -441,7 +441,7 @@ func (s *Server) setupClient() error {
// trader instead.
var interceptor Interceptor = lsat.NewInterceptor(
&s.lndServices.LndServices, s.lsatStore, defaultRPCTimeout,
defaultLsatMaxCost, defaultLsatMaxFee, false,
defaultLsatMaxCost, s.cfg.LsatMaxRoutingFee, false,
)
if s.cfg.FakeAuth && s.cfg.Network == "mainnet" {
return fmt.Errorf("cannot use fake LSAT auth for mainnet")