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:
parent
af742470b3
commit
b6acefd385
@ -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")
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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
|
||||||
|
@ -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",
|
||||||
|
@ -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 {
|
||||||
|
@ -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
|
||||||
|
@ -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(
|
||||||
|
Loading…
Reference in New Issue
Block a user