File tree 1 file changed +9
-3
lines changed
1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,9 @@ func (d *DB) AddInvoice(newInvoice *Invoice, paymentHash lntypes.Hash) (
242
242
}
243
243
244
244
var invoiceAddIndex uint64
245
- err := d .Update (func (tx * bbolt.Tx ) error {
245
+ err := d .Batch (func (tx * bbolt.Tx ) error {
246
+ invoiceAddIndex = 0
247
+
246
248
invoices , err := tx .CreateBucketIfNotExists (invoiceBucket )
247
249
if err != nil {
248
250
return err
@@ -635,7 +637,9 @@ func (d *DB) AcceptOrSettleInvoice(paymentHash [32]byte,
635
637
amtPaid lnwire.MilliSatoshi ) (* Invoice , error ) {
636
638
637
639
var settledInvoice * Invoice
638
- err := d .Update (func (tx * bbolt.Tx ) error {
640
+ err := d .Batch (func (tx * bbolt.Tx ) error {
641
+ settledInvoice = nil
642
+
639
643
invoices , err := tx .CreateBucketIfNotExists (invoiceBucket )
640
644
if err != nil {
641
645
return err
@@ -714,7 +718,9 @@ func (d *DB) SettleHoldInvoice(preimage lntypes.Preimage) (*Invoice, error) {
714
718
// payment hash.
715
719
func (d * DB ) CancelInvoice (paymentHash lntypes.Hash ) (* Invoice , error ) {
716
720
var canceledInvoice * Invoice
717
- err := d .Update (func (tx * bbolt.Tx ) error {
721
+ err := d .Batch (func (tx * bbolt.Tx ) error {
722
+ canceledInvoice = nil
723
+
718
724
invoices , err := tx .CreateBucketIfNotExists (invoiceBucket )
719
725
if err != nil {
720
726
return err
You can’t perform that action at this time.
0 commit comments