@@ -969,7 +969,10 @@ func addCommitmentOutputs(chanType channeldb.ChannelType, localChanCfg,
969969
970970 // We've asserted that we have a non-dust BTC balance if we have an
971971 // asset balance before, so we can just check the asset balance here.
972- if ourAssetBalance > 0 || ourBalance > 0 {
972+ // In case there is no asset balance, and the BTC value is dust, it will
973+ // not be materialized on-chain, and we shouldn't create an allocation
974+ // for it.
975+ if ourAssetBalance > 0 || ourBalance > localChanCfg .DustLimit {
973976 toLocalScript , err := lnwallet .CommitScriptToSelf (
974977 chanType , initiator , keys .ToLocalKey ,
975978 keys .RevocationKey , uint32 (localChanCfg .CsvDelay ),
@@ -1033,7 +1036,10 @@ func addCommitmentOutputs(chanType channeldb.ChannelType, localChanCfg,
10331036 addAllocation (allocation )
10341037 }
10351038
1036- if theirAssetBalance > 0 || theirBalance > 0 {
1039+ // We only create an allocation if there is going to be an on-chain
1040+ // output. If this is dust (which is only allowed if there are no assets
1041+ // on the output), it will not be materialized on-chain.
1042+ if theirAssetBalance > 0 || theirBalance > localChanCfg .DustLimit {
10371043 toRemoteScript , _ , err := lnwallet .CommitScriptToRemote (
10381044 chanType , initiator , keys .ToRemoteKey , leaseExpiry ,
10391045 lfn .None [txscript.TapLeaf ](),
0 commit comments