lnrpc+routerrpc+lncli: add allow_self_payments safety flag

This commit is contained in:
Joost Jager
2019-11-25 14:13:21 +01:00
parent f8e9efbf99
commit 2d19201ede
8 changed files with 759 additions and 689 deletions

View File

@@ -665,6 +665,11 @@ func (r *RouterBackend) extractIntentFromSendRequest(
}
// Check for disallowed payments to self.
if !rpcPayReq.AllowSelfPayment && payIntent.Target == r.SelfNode {
return nil, errors.New("self-payments not allowed")
}
return payIntent, nil
}