From 3edc1a745611d1643e8915688bbe9cccde94d93b Mon Sep 17 00:00:00 2001 From: "Johan T. Halseth" Date: Sun, 17 Dec 2017 16:08:21 +0100 Subject: [PATCH] fundingmanager: define min and maxRemoteDelay This commit defines minRemoteDelay and maxRemoteDelay, which is the extremes of the CSV delay we will require the remote to use for its commitment transaction. The actual delay we will require will be somewhere between these values, depending on channel size. --- fundingmanager.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fundingmanager.go b/fundingmanager.go index 75ba76d6..65f411c2 100644 --- a/fundingmanager.go +++ b/fundingmanager.go @@ -32,8 +32,6 @@ const ( // TODO(roasbeef): tune msgBufferSize = 50 - defaultCsvDelay = 4 - // maxFundingAmount is a soft-limit of the maximum channel size // accepted within the Lightning Protocol Currently. This limit is // currently defined in BOLT-0002, and serves as an initial @@ -43,6 +41,13 @@ const ( // TODO(roasbeef): add command line param to modify maxFundingAmount = btcutil.Amount(1 << 24) + // minRemoteDelay and maxRemoteDelay is the extremes of the CSV delay + // we will require the remote to use for its commitment transaction. + // The actual delay we will require will be somewhere between these + // values, depending on channel size. + minRemoteDelay = 144 + maxRemoteDelay = 2016 + // maxWaitNumBlocksFundingConf is the maximum number of blocks to wait // for the funding transaction to be confirmed before forgetting about // the channel. 288 blocks is ~48 hrs