File tree Expand file tree Collapse file tree 3 files changed +12
-8
lines changed
src/DotNetLightning.Core/Channel Expand file tree Collapse file tree 3 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -882,7 +882,8 @@ module Channel =
882882
883883 | WeAcceptedOperationUpdateFee(_ msg, newCommitments), ChannelState.Normal d ->
884884 { c with State = ChannelState.Normal({ d with Commitments = newCommitments }) }
885- | WeAcceptedUpdateFee(_ msg), ChannelState.Normal _ d -> c
885+ | WeAcceptedUpdateFee(_ msg, newCommitments), ChannelState.Normal normalData ->
886+ { c with State = ChannelState.Normal({ normalData with Commitments = newCommitments }) }
886887
887888 | WeAcceptedOperationSign(_ msg, newCommitments), ChannelState.Normal d ->
888889 { c with State = ChannelState.Normal({ d with Commitments = newCommitments }) }
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ type ChannelEvent =
285285 | WeAcceptedFailMalformedHTLC of origin : HTLCSource * msg : UpdateAddHTLCMsg * newCommitments : Commitments
286286
287287 | WeAcceptedOperationUpdateFee of msg : UpdateFeeMsg * nextCommitments : Commitments
288- | WeAcceptedUpdateFee of msg : UpdateFeeMsg
288+ | WeAcceptedUpdateFee of msg : UpdateFeeMsg * newCommitments : Commitments
289289
290290 | WeAcceptedOperationSign of msg : CommitmentSignedMsg * nextCommitments : Commitments
291291 | WeAcceptedCommitmentSigned of msg : RevokeAndACKMsg * nextCommitments : Commitments
Original file line number Diff line number Diff line change @@ -251,19 +251,22 @@ module internal Commitments =
251251 else
252252 result {
253253 do ! Helpers.checkUpdateFee ( config) ( msg) ( localFeerate)
254- let c1 = cm.AddRemoteProposal( msg)
254+ let nextCommitments = cm.AddRemoteProposal( msg)
255255 let! reduced =
256- c1.LocalCommit.Spec.Reduce( c1.LocalChanges.ACKed, c1.RemoteChanges.Proposed) |> expectTransactionError
256+ nextCommitments.LocalCommit.Spec.Reduce(
257+ nextCommitments.LocalChanges.ACKed,
258+ nextCommitments.RemoteChanges.Proposed
259+ ) |> expectTransactionError
257260
258- let fees = Transactions.commitTxFee( c1 .RemoteParams.DustLimitSatoshis) reduced
259- let missing = reduced.ToRemote.ToMoney() - c1 .RemoteParams.ChannelReserveSatoshis - fees
261+ let fees = Transactions.commitTxFee( nextCommitments .RemoteParams.DustLimitSatoshis) reduced
262+ let missing = reduced.ToRemote.ToMoney() - nextCommitments .RemoteParams.ChannelReserveSatoshis - fees
260263 if ( missing < Money.Zero) then
261264 return !
262- ( c1 .LocalParams.ChannelReserveSatoshis, fees, (- 1 * missing))
265+ ( nextCommitments .LocalParams.ChannelReserveSatoshis, fees, (- 1 * missing))
263266 |> cannotAffordFee
264267 else
265268 return
266- [ WeAcceptedUpdateFee msg ]
269+ [ WeAcceptedUpdateFee( msg, nextCommitments ) ]
267270 }
268271
269272 let sendCommit ( channelPrivKeys : ChannelPrivKeys ) ( n : Network ) ( cm : Commitments ) =
You can’t perform that action at this time.
0 commit comments