channeldb: update ChannelConstraints godoc
This commit changes the definition of the constraints in the ChannelConstraints struct to specify that these are all constraints the *owner* of the set of constraints must *never violate*. This is done to make it easier to check that a particular node is not violating any constraint for a gien update, as before it could violate constraints found both in its local and the remote contraints.
This commit is contained in:
parent
d924fcfdf4
commit
65723387fa
@ -109,7 +109,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// ChannelConstraints represents a set of constraints meant to allow a node to
|
// ChannelConstraints represents a set of constraints meant to allow a node to
|
||||||
// limit their exposure, enact flow control and ensure that all HTLC's are
|
// limit their exposure, enact flow control and ensure that all HTLCs are
|
||||||
// economically relevant This struct will be mirrored for both sides of the
|
// economically relevant This struct will be mirrored for both sides of the
|
||||||
// channel, as each side will enforce various constraints that MUST be adhered
|
// channel, as each side will enforce various constraints that MUST be adhered
|
||||||
// to for the life time of the channel. The parameters for each of these
|
// to for the life time of the channel. The parameters for each of these
|
||||||
@ -121,27 +121,28 @@ type ChannelConstraints struct {
|
|||||||
// as an actual output, but is instead burned to miner's fees.
|
// as an actual output, but is instead burned to miner's fees.
|
||||||
DustLimit btcutil.Amount
|
DustLimit btcutil.Amount
|
||||||
|
|
||||||
// MaxPendingAmount is the maximum pending HTLC value that can be
|
// ChanReserve is an absolute reservation on the channel for the
|
||||||
// present within the channel at a particular time. This value is set
|
// owner of this set of constraints. This means that the current
|
||||||
// by the initiator of the channel and must be upheld at all times.
|
// settled balance for this node CANNOT dip below the reservation
|
||||||
MaxPendingAmount lnwire.MilliSatoshi
|
// amount. This acts as a defense against costless attacks when
|
||||||
|
// either side no longer has any skin in the game.
|
||||||
// ChanReserve is an absolute reservation on the channel for this
|
|
||||||
// particular node. This means that the current settled balance for
|
|
||||||
// this node CANNOT dip below the reservation amount. This acts as a
|
|
||||||
// defense against costless attacks when either side no longer has any
|
|
||||||
// skin in the game.
|
|
||||||
ChanReserve btcutil.Amount
|
ChanReserve btcutil.Amount
|
||||||
|
|
||||||
// MinHTLC is the minimum HTLC accepted for a direction of the channel.
|
// MaxPendingAmount is the maximum pending HTLC value that the
|
||||||
// If any HTLC's below this amount are offered, then the HTLC will be
|
// owner of these constraints can offer the remote node at a
|
||||||
// rejected. This, in tandem with the dust limit allows a node to
|
// particular time.
|
||||||
// regulate the smallest HTLC that it deems economically relevant.
|
MaxPendingAmount lnwire.MilliSatoshi
|
||||||
|
|
||||||
|
// MinHTLC is the minimum HTLC value that the the owner of these
|
||||||
|
// constraints can offer the remote node. If any HTLCs below this
|
||||||
|
// amount are offered, then the HTLC will be rejected. This, in
|
||||||
|
// tandem with the dust limit allows a node to regulate the
|
||||||
|
// smallest HTLC that it deems economically relevant.
|
||||||
MinHTLC lnwire.MilliSatoshi
|
MinHTLC lnwire.MilliSatoshi
|
||||||
|
|
||||||
// MaxAcceptedHtlcs is the maximum amount of HTLC's that are to be
|
// MaxAcceptedHtlcs is the maximum number of HTLCs that the owner of
|
||||||
// accepted by the owner of this set of constraints. This allows each
|
// this set of constraints can offer the remote node. This allows each
|
||||||
// node to limit their over all exposure to HTLC's that may need to be
|
// node to limit their over all exposure to HTLCs that may need to be
|
||||||
// acted upon in the case of a unilateral channel closure or a contract
|
// acted upon in the case of a unilateral channel closure or a contract
|
||||||
// breach.
|
// breach.
|
||||||
MaxAcceptedHtlcs uint16
|
MaxAcceptedHtlcs uint16
|
||||||
|
Loading…
Reference in New Issue
Block a user