mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-07-12 14:12:27 +02:00
multi: add reset closure to kvdb.View
This commit adds a reset() closure to the kvdb.View function which will be called before each retry (including the first) of the view transaction. The reset() closure can be used to reset external state (eg slices or maps) where the view closure puts intermediate results.
This commit is contained in:
@ -786,6 +786,8 @@ func loadFwdPkgs(t *testing.T, db kvdb.Backend,
|
||||
var err error
|
||||
fwdPkgs, err = packager.LoadFwdPkgs(tx)
|
||||
return err
|
||||
}, func() {
|
||||
fwdPkgs = nil
|
||||
}); err != nil {
|
||||
t.Fatalf("unable to load fwd pkgs: %v", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user