From 6f208bce40e9fd3731eb018e1f1bc169a095774e Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 1 Jul 2020 21:06:05 -0700 Subject: [PATCH] server+funding: use max values for csv delay and confs for wumbo channels --- server.go | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/server.go b/server.go index 612f2970..fe711cec 100644 --- a/server.go +++ b/server.go @@ -1034,11 +1034,18 @@ func newServer(cfg *Config, listenAddrs []net.Addr, chanDB *channeldb.DB, return defaultConf } + minConf := uint64(3) + maxConf := uint64(6) + + // If this is a wumbo channel, then we'll require the + // max amount of confirmations. + if chanAmt > MaxFundingAmount { + return uint16(maxConf) + } + // If not we return a value scaled linearly // between 3 and 6, depending on channel size. // TODO(halseth): Use 1 as minimum? - minConf := uint64(3) - maxConf := uint64(6) maxChannelSize := uint64( lnwire.NewMSatFromSatoshis(MaxFundingAmount)) stake := lnwire.NewMSatFromSatoshis(chanAmt) + pushAmt @@ -1067,6 +1074,12 @@ func newServer(cfg *Config, listenAddrs []net.Addr, chanDB *channeldb.DB, return defaultDelay } + // If this is a wumbo channel, then we'll require the + // max value. + if chanAmt > MaxFundingAmount { + return maxRemoteDelay + } + // If not we scale according to channel size. delay := uint16(btcutil.Amount(maxRemoteDelay) * chanAmt / MaxFundingAmount)