2
0
mirror of https://github.com/guggero/chantools synced 2024-11-11 01:10:42 +00:00

Fix chain parameters for all commands

This commit is contained in:
Oliver Gugger 2020-02-10 11:25:32 +01:00
parent af742470b3
commit b6acefd385
No known key found for this signature in database
GPG Key ID: 8E4256593F177720
8 changed files with 18 additions and 1 deletions

View File

@ -17,6 +17,8 @@ type dumpChannelsCommand struct {
} }
func (c *dumpChannelsCommand) Execute(_ []string) error { func (c *dumpChannelsCommand) Execute(_ []string) error {
setupChainParams(cfg)
// Check that we have a channel DB. // Check that we have a channel DB.
if c.ChannelDB == "" { if c.ChannelDB == "" {
return fmt.Errorf("channel DB is required") return fmt.Errorf("channel DB is required")

View File

@ -25,6 +25,8 @@ type forceCloseCommand struct {
} }
func (c *forceCloseCommand) Execute(_ []string) error { func (c *forceCloseCommand) Execute(_ []string) error {
setupChainParams(cfg)
var ( var (
extendedKey *hdkeychain.ExtendedKey extendedKey *hdkeychain.ExtendedKey
err error err error

View File

@ -23,6 +23,8 @@ type genImportScriptCommand struct {
} }
func (c *genImportScriptCommand) Execute(_ []string) error { func (c *genImportScriptCommand) Execute(_ []string) error {
setupChainParams(cfg)
var ( var (
extendedKey *hdkeychain.ExtendedKey extendedKey *hdkeychain.ExtendedKey
err error err error

View File

@ -37,6 +37,8 @@ type rescueClosedCommand struct {
} }
func (c *rescueClosedCommand) Execute(_ []string) error { func (c *rescueClosedCommand) Execute(_ []string) error {
setupChainParams(cfg)
var ( var (
extendedKey *hdkeychain.ExtendedKey extendedKey *hdkeychain.ExtendedKey
err error err error

View File

@ -7,6 +7,8 @@ import (
type showRootKeyCommand struct{} type showRootKeyCommand struct{}
func (c *showRootKeyCommand) Execute(_ []string) error { func (c *showRootKeyCommand) Execute(_ []string) error {
setupChainParams(cfg)
rootKey, _, err := rootKeyFromConsole() rootKey, _, err := rootKeyFromConsole()
if err != nil { if err != nil {
return fmt.Errorf("failed to read root key from console: %v", return fmt.Errorf("failed to read root key from console: %v",

View File

@ -13,6 +13,8 @@ import (
type summaryCommand struct{} type summaryCommand struct{}
func (c *summaryCommand) Execute(_ []string) error { func (c *summaryCommand) Execute(_ []string) error {
setupChainParams(cfg)
// Parse channel entries from any of the possible input files. // Parse channel entries from any of the possible input files.
entries, err := parseInputType(cfg) entries, err := parseInputType(cfg)
if err != nil { if err != nil {

View File

@ -27,6 +27,8 @@ type sweepTimeLockCommand struct {
} }
func (c *sweepTimeLockCommand) Execute(_ []string) error { func (c *sweepTimeLockCommand) Execute(_ []string) error {
setupChainParams(cfg)
var ( var (
extendedKey *hdkeychain.ExtendedKey extendedKey *hdkeychain.ExtendedKey
err error err error

View File

@ -45,6 +45,8 @@ type walletInfoCommand struct {
} }
func (c *walletInfoCommand) Execute(_ []string) error { func (c *walletInfoCommand) Execute(_ []string) error {
setupChainParams(cfg)
var ( var (
publicWalletPw = lnwallet.DefaultPublicPassphrase publicWalletPw = lnwallet.DefaultPublicPassphrase
privateWalletPw = lnwallet.DefaultPrivatePassphrase privateWalletPw = lnwallet.DefaultPrivatePassphrase
@ -109,7 +111,8 @@ func walletInfo(w *wallet.Wallet) error {
}, },
}) })
if err != nil { if err != nil {
return err return fmt.Errorf("unable to open key ring for coin type %d: " +
"%v", chainParams.HDCoinType, err)
} }
idPrivKey.Curve = btcec.S256() idPrivKey.Curve = btcec.S256()
fmt.Printf( fmt.Printf(