Skip to content

Commit

Permalink
Merge pull request #3098 from cfromknecht/increase-funding-timeout
Browse files Browse the repository at this point in the history
fundingmanager: bump max non-initiator funding timeout to 2 weeks
  • Loading branch information
halseth committed May 22, 2019
2 parents 3390803 + 0865478 commit 437f839
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions fundingmanager.go
Expand Up @@ -49,9 +49,9 @@ const (
maxLtcRemoteDelay uint16 = 8064

// 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
maxWaitNumBlocksFundingConf = 288
// for the funding transaction to be confirmed before forgetting
// channels that aren't initiated by us. 2016 blocks is ~2 weeks.
maxWaitNumBlocksFundingConf = 2016

// minChanFundingSize is the smallest channel that we'll allow to be
// created over the RPC interface.
Expand Down
8 changes: 4 additions & 4 deletions fundingmanager_test.go
Expand Up @@ -1597,17 +1597,17 @@ func TestFundingManagerFundingTimeout(t *testing.T) {
len(pendingChannels))
}

// We expect Bob to forget the channel after 288 blocks (48 hours), so
// mine 287, and check that it is still pending.
// We expect Bob to forget the channel after 2016 blocks (2 weeks), so
// mine 2016-1, and check that it is still pending.
bob.mockNotifier.epochChan <- &chainntnfs.BlockEpoch{
Height: fundingBroadcastHeight + 287,
Height: fundingBroadcastHeight + maxWaitNumBlocksFundingConf - 1,
}

// Bob should still be waiting for the channel to open.
assertNumPendingChannelsRemains(t, bob, 1)

bob.mockNotifier.epochChan <- &chainntnfs.BlockEpoch{
Height: fundingBroadcastHeight + 288,
Height: fundingBroadcastHeight + maxWaitNumBlocksFundingConf,
}

// Bob should have sent an Error message to Alice.
Expand Down

0 comments on commit 437f839

Please sign in to comment.