mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-20 13:34:32 +01:00
channeldb/invoices: add idempotency to SettleInvoice
This commit is contained in:
parent
e4d2958f68
commit
7a93c7530c
1 changed files with 6 additions and 0 deletions
|
@ -432,6 +432,12 @@ func settleInvoice(invoices *bolt.Bucket, invoiceNum []byte) error {
|
|||
return err
|
||||
}
|
||||
|
||||
// Add idempotency to duplicate settles, return here to avoid
|
||||
// overwriting the previous info.
|
||||
if invoice.Terms.Settled {
|
||||
return nil
|
||||
}
|
||||
|
||||
invoice.Terms.Settled = true
|
||||
invoice.SettleDate = time.Now()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue