mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
invoices/invoiceregistry: unbundle invalid preimage error
This commit is contained in:
parent
9da3e7fc90
commit
137258fb58
1 changed files with 6 additions and 2 deletions
|
@ -707,8 +707,12 @@ func (i *InvoiceRegistry) processKeySend(ctx invoiceUpdateCtx) error {
|
||||||
|
|
||||||
// Cancel htlc is preimage is invalid.
|
// Cancel htlc is preimage is invalid.
|
||||||
preimage, err := lntypes.MakePreimage(preimageSlice)
|
preimage, err := lntypes.MakePreimage(preimageSlice)
|
||||||
if err != nil || preimage.Hash() != ctx.hash {
|
if err != nil {
|
||||||
return errors.New("invalid keysend preimage")
|
return err
|
||||||
|
}
|
||||||
|
if preimage.Hash() != ctx.hash {
|
||||||
|
return fmt.Errorf("invalid keysend preimage %v for hash %v",
|
||||||
|
preimage, ctx.hash)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only allow keysend for non-mpp payments.
|
// Only allow keysend for non-mpp payments.
|
||||||
|
|
Loading…
Add table
Reference in a new issue