mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-24 18:44:08 +02:00
htlcswitch+lnwallet: add malformed payment descriptor
This commit is contained in:
committed by
Olaoluwa Osuntokun
parent
e29193d550
commit
a10ed36e8f
@@ -1513,7 +1513,9 @@ func (l *channelLink) sendHTLCError(rHash [32]byte, failure lnwire.FailureMessag
|
||||
// to the payment sender.
|
||||
func (l *channelLink) sendMalformedHTLCError(rHash [32]byte, code lnwire.FailCode,
|
||||
onionBlob []byte) {
|
||||
index, err := l.channel.FailHTLC(rHash)
|
||||
|
||||
shaOnionBlob := sha256.Sum256(onionBlob)
|
||||
index, err := l.channel.MalformedFailHTLC(rHash, code, shaOnionBlob)
|
||||
if err != nil {
|
||||
log.Errorf("unable cancel htlc: %v", err)
|
||||
return
|
||||
@@ -1522,7 +1524,7 @@ func (l *channelLink) sendMalformedHTLCError(rHash [32]byte, code lnwire.FailCod
|
||||
l.cfg.Peer.SendMessage(&lnwire.UpdateFailMalformedHTLC{
|
||||
ChanID: l.ChanID(),
|
||||
ID: index,
|
||||
ShaOnionBlob: sha256.Sum256(onionBlob),
|
||||
ShaOnionBlob: shaOnionBlob,
|
||||
FailureCode: code,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user