htlcswitch: allow overpaying for incoming payments
In this commit, we relax the constraints on accepting an exit hop payment a bit. We'll now accept any incoming payment that _at least_ pays the invoice amount. This puts us further inline with the specification, which recommends that nodes accept overpayment by a certain margin. Fixes #1002.
This commit is contained in:
2 files changed
+85
-2
No files matched your search
+1
-1
@@ -1962,7 +1962,7 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
||||
// they wish to send. So since we expect the htlc to
|
||||
// have a different amount, we should not fail.
|
||||
if !l.cfg.DebugHTLC && invoice.Terms.Value > 0 &&
|
||||
fwdInfo.AmountToForward != invoice.Terms.Value {
|
||||
fwdInfo.AmountToForward < invoice.Terms.Value {
|
||||
|
||||
log.Errorf("Onion payload of incoming htlc(%x) "+
|
||||
"has incorrect value: expected %v, "+
|
||||
|
||||
Reference in new issue
Block a user