mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
channeldb: remove unused tx argument
This commit is contained in:
parent
ee9d6f21bd
commit
28c8e8b6dd
@ -1417,7 +1417,7 @@ func (c *ChannelStateDB) DeleteChannelOpeningState(outPoint []byte) error {
|
||||
// applies migration functions to the current database and recovers the
|
||||
// previous state of db if at least one error/panic appeared during migration.
|
||||
func (d *DB) syncVersions(versions []mandatoryVersion) error {
|
||||
meta, err := d.FetchMeta(nil)
|
||||
meta, err := d.FetchMeta()
|
||||
if err != nil {
|
||||
if err == ErrMetaNotFound {
|
||||
meta = &Meta{}
|
||||
|
@ -28,9 +28,8 @@ type Meta struct {
|
||||
DbVersionNumber uint32
|
||||
}
|
||||
|
||||
// FetchMeta fetches the meta data from boltdb and returns filled meta
|
||||
// structure.
|
||||
func (d *DB) FetchMeta(tx kvdb.RTx) (*Meta, error) {
|
||||
// FetchMeta fetches the metadata from boltdb and returns filled meta structure.
|
||||
func (d *DB) FetchMeta() (*Meta, error) {
|
||||
var meta *Meta
|
||||
|
||||
err := kvdb.View(d, func(tx kvdb.RTx) error {
|
||||
|
@ -91,7 +91,7 @@ func TestVersionFetchPut(t *testing.T) {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
meta, err := db.FetchMeta(nil)
|
||||
meta, err := db.FetchMeta()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -107,7 +107,7 @@ func TestVersionFetchPut(t *testing.T) {
|
||||
t.Fatalf("update of meta failed %v", err)
|
||||
}
|
||||
|
||||
meta, err = db.FetchMeta(nil)
|
||||
meta, err = db.FetchMeta()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -228,7 +228,7 @@ func TestMigrationWithPanic(t *testing.T) {
|
||||
|
||||
// Check that version of database and data wasn't changed.
|
||||
afterMigrationFunc := func(d *DB) {
|
||||
meta, err := d.FetchMeta(nil)
|
||||
meta, err := d.FetchMeta()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -303,7 +303,7 @@ func TestMigrationWithFatal(t *testing.T) {
|
||||
|
||||
// Check that version of database and initial data wasn't changed.
|
||||
afterMigrationFunc := func(d *DB) {
|
||||
meta, err := d.FetchMeta(nil)
|
||||
meta, err := d.FetchMeta()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -377,7 +377,7 @@ func TestMigrationWithoutErrors(t *testing.T) {
|
||||
|
||||
// Check that version of database and data was properly changed.
|
||||
afterMigrationFunc := func(d *DB) {
|
||||
meta, err := d.FetchMeta(nil)
|
||||
meta, err := d.FetchMeta()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@ -469,7 +469,7 @@ func TestMigrationDryRun(t *testing.T) {
|
||||
// Check that version of database version is not modified.
|
||||
afterMigrationFunc := func(d *DB) {
|
||||
err := kvdb.View(d, func(tx kvdb.RTx) error {
|
||||
meta, err := d.FetchMeta(nil)
|
||||
meta, err := d.FetchMeta()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user