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 =
882
882
883
883
| WeAcceptedOperationUpdateFee(_ msg, newCommitments), ChannelState.Normal d ->
884
884
{ 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 }) }
886
887
887
888
| WeAcceptedOperationSign(_ msg, newCommitments), ChannelState.Normal d ->
888
889
{ 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 =
285
285
| WeAcceptedFailMalformedHTLC of origin : HTLCSource * msg : UpdateAddHTLCMsg * newCommitments : Commitments
286
286
287
287
| WeAcceptedOperationUpdateFee of msg : UpdateFeeMsg * nextCommitments : Commitments
288
- | WeAcceptedUpdateFee of msg : UpdateFeeMsg
288
+ | WeAcceptedUpdateFee of msg : UpdateFeeMsg * newCommitments : Commitments
289
289
290
290
| WeAcceptedOperationSign of msg : CommitmentSignedMsg * nextCommitments : Commitments
291
291
| WeAcceptedCommitmentSigned of msg : RevokeAndACKMsg * nextCommitments : Commitments
Original file line number Diff line number Diff line change @@ -251,19 +251,22 @@ module internal Commitments =
251
251
else
252
252
result {
253
253
do ! Helpers.checkUpdateFee ( config) ( msg) ( localFeerate)
254
- let c1 = cm.AddRemoteProposal( msg)
254
+ let nextCommitments = cm.AddRemoteProposal( msg)
255
255
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
257
260
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
260
263
if ( missing < Money.Zero) then
261
264
return !
262
- ( c1 .LocalParams.ChannelReserveSatoshis, fees, (- 1 * missing))
265
+ ( nextCommitments .LocalParams.ChannelReserveSatoshis, fees, (- 1 * missing))
263
266
|> cannotAffordFee
264
267
else
265
268
return
266
- [ WeAcceptedUpdateFee msg ]
269
+ [ WeAcceptedUpdateFee( msg, nextCommitments ) ]
267
270
}
268
271
269
272
let sendCommit ( channelPrivKeys : ChannelPrivKeys ) ( n : Network ) ( cm : Commitments ) =
You can’t perform that action at this time.
0 commit comments