multi: add reset closure to kvdb.Update
Similarly as with kvdb.View this commits adds a reset closure to the kvdb.Update call in order to be able to reset external state if the underlying db backend needs to retry the transaction.
This commit is contained in:
44 files changed
+208
-162
No files matched your search
+2
-2
@@ -92,7 +92,7 @@ func NewSweeperStore(db kvdb.Backend, chainHash *chainhash.Hash) (
|
||||
err = migrateTxHashes(tx, txHashesBucket, chainHash)
|
||||
|
||||
return err
|
||||
})
|
||||
}, func() {})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -193,7 +193,7 @@ func (s *sweeperStore) NotifyPublishTx(sweepTx *wire.MsgTx) error {
|
||||
hash := sweepTx.TxHash()
|
||||
|
||||
return txHashesBucket.Put(hash[:], []byte{})
|
||||
})
|
||||
}, func() {})
|
||||
}
|
||||
|
||||
// GetLastPublishedTx returns the last tx that we called NotifyPublishTx
|
||||
|
||||
Reference in new issue
Block a user