Skip to content

Commit 8865a7f

Browse files
committed
Update fee after channel becomes active
1 parent 71ba355 commit 8865a7f

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,8 @@ func TestChannelLinkCancelFullCommitment(t *testing.T) {
856856
n := newTwoHopNetwork(
857857
t, channels.aliceToBob, channels.bobToAlice, testStartingHeight,
858858
)
859+
n.aliceChannelLink.updateFeeTimer.Reset(time.Minute * 10)
860+
n.bobChannelLink.updateFeeTimer.Reset(time.Minute * 10)
859861

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

0 commit comments

Comments
 (0)