invoices/invoiceregistry: unbundle invalid preimage error
This commit is contained in:
parent
9da3e7fc90
commit
137258fb58
@ -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…
Reference in New Issue
Block a user