Skip to content

Commit 36bb685

Browse files
committed
Update fee after channel becomes active
1 parent 71ba355 commit 36bb685

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

htlcswitch/link.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,9 @@ func (l *channelLink) Start() error {
533533
}()
534534
}
535535

536-
l.updateFeeTimer = time.NewTimer(l.randomFeeUpdateTimeout())
536+
// this timer will fire in one minute after the channel is ready
537+
// and it will reset to a random interval after that
538+
l.updateFeeTimer = time.NewTimer(time.Minute)
537539

538540
l.wg.Add(1)
539541
go l.htlcManager()

htlcswitch/link_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,10 @@ func TestChannelLinkCancelFullCommitment(t *testing.T) {
856856
n := newTwoHopNetwork(
857857
t, channels.aliceToBob, channels.bobToAlice, testStartingHeight,
858858
)
859+
// This test takes a long time to finish and the link breaks if the fee
860+
// update times out during it, blocking the test indefinitely
861+
n.aliceChannelLink.updateFeeTimer.Reset(time.Minute * 10)
862+
n.bobChannelLink.updateFeeTimer.Reset(time.Minute * 10)
859863

860864
// Fill up the commitment from Alice's side with 20 sat payments.
861865
count := (input.MaxHTLCNumber / 2)

0 commit comments

Comments
 (0)