mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-01 18:27:43 +02:00
multi: break ChannelConstraints into two sub-structures
This commit breaks the ChannelConstraints structure into two sub-structures that reflect the fundamental differences in how these parameters are used. On its face it may not seem necessary, however the distinction introduced here is relevant for how we will be implementing the Dynamic Commitments proposal.
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user