lnwallet: add new method to register our preferred minHTLC value

Before this commit, during a reservation, we wouldn’t ever specify our
minHTL value. We don’t yet fully validate all channel constrains, but
doing this now serves to ensure that once those features are merged,
we’ll actually be setting a valid value for minHTLC.
This commit is contained in:
Olaoluwa Osuntokun committed 2017-12-13 17:15:43 -08:00
1 parent a036098e36
commit 5e5cc9b209
2 files changed
+14 -4

No files matched your search

+10
View File
@@ -258,6 +258,16 @@ func (r *ChannelReservation) SetNumConfsRequired(numConfs uint16) {
r.partialState.NumConfsRequired = numConfs
}
// RegisterMinHTLC registers our desired amount for the smallest acceptable
// HTLC we'll accept within this channel. Any HTLC's that are extended which
// are below this value will SHOULD be rejected.
func (r *ChannelReservation) RegisterMinHTLC(minHTLC lnwire.MilliSatoshi) {
r.Lock()
defer r.Unlock()
r.ourContribution.MinHTLC = minHTLC
}
// CommitConstraints takes the constraints that the remote party specifies for
// the type of commitments that we can generate for them. These constraints
// include several parameters that serve as flow control restricting the amount