mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-29 14:35:26 +02:00
htlcswitch: reject HTLCs that use use as introduction if disabled
Reject any HTLCs that use us as an introduction point in a blinded route if we have disabled route blinding. We have to do this after we've processed the payload, because we only know we're an introduction point once we've processed the payload itself.
This commit is contained in:
@@ -3309,6 +3309,27 @@ func (l *channelLink) processRemoteAdds(fwdPkg *channeldb.FwdPkg,
|
||||
|
||||
fwdInfo := pld.ForwardingInfo()
|
||||
|
||||
// Check whether the payload we've just processed uses our
|
||||
// node as the introduction point (gave us a blinding key in
|
||||
// the payload itself) and fail it back if we don't support
|
||||
// route blinding.
|
||||
if fwdInfo.NextBlinding.IsSome() &&
|
||||
l.cfg.DisallowRouteBlinding {
|
||||
|
||||
failure := lnwire.NewInvalidBlinding(
|
||||
onionBlob[:],
|
||||
)
|
||||
l.sendHTLCError(
|
||||
pd, NewLinkError(failure), obfuscator, false,
|
||||
)
|
||||
|
||||
l.log.Error("rejected htlc that uses use as an " +
|
||||
"introduction point when we do not support " +
|
||||
"route blinding")
|
||||
|
||||
continue
|
||||
}
|
||||
|
||||
switch fwdInfo.NextHop {
|
||||
case hop.Exit:
|
||||
err := l.processExitHop(
|
||||
|
Reference in New Issue
Block a user