channeldb: remove hardcoded netparams

This commit is contained in:
Olaoluwa Osuntokun
2016-04-24 12:35:52 -07:00
parent 1e35018e89
commit fa1e7a332f
4 changed files with 13 additions and 9 deletions

View File

@@ -6,13 +6,11 @@ import (
"golang.org/x/crypto/ripemd160"
"github.com/boltdb/bolt"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcutil"
)
var (
idBucket = []byte("i")
ActiveNetParams = &chaincfg.TestNet3Params
idBucket = []byte("i")
)
// PutIdKey saves the hash160 of the public key used for our identity within
@@ -52,5 +50,5 @@ func (d *DB) GetIdAdr() (*btcutil.AddressPubKeyHash, error) {
}
log.Infof("identity key has length %d", len(pkh))
return btcutil.NewAddressPubKeyHash(pkh, ActiveNetParams)
return btcutil.NewAddressPubKeyHash(pkh, d.netParams)
}