Skip to content

Commit da19fcb

Browse files
committed
Fix bug in accept_channel msg validation
The function checkDustLimitIsLargerThanOurChannelReserve was calculating the channel reserve based on the funding amount of the open_channel message, rather than using the channel reserve that was actually sent in the open_channel message. This fixes the bug.
1 parent 7f271b2 commit da19fcb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/DotNetLightning.Core/Channel/ChannelError.fs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,9 +428,8 @@ module internal AcceptChannelMsgValidation =
428428
Ok()
429429

430430
let checkDustLimitIsLargerThanOurChannelReserve (state: Data.WaitForAcceptChannelData) msg =
431-
let reserve = ChannelConstantHelpers.getOurChannelReserve state.LastSent.FundingSatoshis
432431
check
433-
msg.DustLimitSatoshis (>) reserve
432+
msg.DustLimitSatoshis (>) state.LastSent.ChannelReserveSatoshis
434433
"dust limit (%A) is bigger than our channel reserve (%A)"
435434

436435
let checkMinimumHTLCValueIsAcceptable (state: Data.WaitForAcceptChannelData) (msg: AcceptChannel) =

0 commit comments

Comments
 (0)