Merge pull request #8953 from ProofOfKeags/refactor/lnwallet-channel-channel-constraints-partition

[MICRO]: multi: break ChannelConstraints into two sub-structures
This commit is contained in:
Oliver Gugger
2024-08-05 02:08:52 -06:00
committed by GitHub
15 changed files with 338 additions and 242 deletions

View File

@@ -279,7 +279,7 @@ func (r *Manager) getHtlcAmtLimits(tx kvdb.RTx, chanPoint wire.OutPoint) (
// capacity AND less than or equal to the max in-flight HTLC value.
// Since the latter is always less than or equal to the former, just
// return the max in-flight value.
maxAmt := ch.LocalChanCfg.ChannelConstraints.MaxPendingAmount
maxAmt := ch.LocalChanCfg.ChannelStateBounds.MaxPendingAmount
return ch.LocalChanCfg.MinHTLC, maxAmt, nil
}

View File

@@ -125,14 +125,14 @@ func TestManager(t *testing.T) {
return &channeldb.OpenChannel{}, channeldb.ErrChannelNotFound
}
constraints := channeldb.ChannelConstraints{
bounds := channeldb.ChannelStateBounds{
MaxPendingAmount: maxPendingAmount,
MinHTLC: minHTLC,
}
return &channeldb.OpenChannel{
LocalChanCfg: channeldb.ChannelConfig{
ChannelConstraints: constraints,
ChannelStateBounds: bounds,
},
}, nil
}