channeldb: Open is no longer dependant on a specific set of chain params

This commit is contained in:
Olaoluwa Osuntokun
2016-12-22 12:09:19 -08:00
parent 587bde5636
commit 597b4ee3d3
6 changed files with 11 additions and 15 deletions

View File

@@ -10,7 +10,6 @@ import (
"github.com/boltdb/bolt"
"github.com/roasbeef/btcd/btcec"
"github.com/roasbeef/btcd/chaincfg"
"github.com/roasbeef/btcd/wire"
)
@@ -56,13 +55,12 @@ var bufPool = &sync.Pool{
// schedules, and reputation data.
type DB struct {
*bolt.DB
netParams *chaincfg.Params
dbPath string
dbPath string
}
// Open opens an existing channeldb. Any necessary schemas migrations due to
// udpates will take plave as necessary.
func Open(dbPath string, netParams *chaincfg.Params) (*DB, error) {
func Open(dbPath string) (*DB, error) {
path := filepath.Join(dbPath, dbName)
if !fileExists(path) {
@@ -77,9 +75,8 @@ func Open(dbPath string, netParams *chaincfg.Params) (*DB, error) {
}
chanDB := &DB{
DB: bdb,
netParams: netParams,
dbPath: dbPath,
DB: bdb,
dbPath: dbPath,
}
// Synchronize the version of database and apply migrations if needed.