routing: skip max htlc validation when capacity is 0
Since light clients no longer have access to an edge's capacity, they are unable to validate whether the max HTLC value for an updated edge policy respects the capacity limit. As a stop-gap, we'll skip this check.
This commit is contained in:
parent
f2637d63ba
commit
5d3621cc83
@ -171,11 +171,15 @@ func validateOptionalFields(capacity btcutil.Amount,
|
|||||||
return errors.Errorf("invalid max htlc for channel "+
|
return errors.Errorf("invalid max htlc for channel "+
|
||||||
"update %v", spew.Sdump(msg))
|
"update %v", spew.Sdump(msg))
|
||||||
}
|
}
|
||||||
cap := lnwire.NewMSatFromSatoshis(capacity)
|
|
||||||
if maxHtlc > cap {
|
// For light clients, the capacity will not be set so we'll skip
|
||||||
|
// checking whether the MaxHTLC value respects the channel's
|
||||||
|
// capacity.
|
||||||
|
capacityMsat := lnwire.NewMSatFromSatoshis(capacity)
|
||||||
|
if capacityMsat != 0 && maxHtlc > capacityMsat {
|
||||||
return errors.Errorf("max_htlc(%v) for channel "+
|
return errors.Errorf("max_htlc(%v) for channel "+
|
||||||
"update greater than capacity(%v)", maxHtlc,
|
"update greater than capacity(%v)", maxHtlc,
|
||||||
cap)
|
capacityMsat)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user