Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added simnet support for litecoind #2188

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions chainparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ var litecoinMainNetParams = litecoinNetParams{
CoinType: keychain.CoinTypeLitecoin,
}

// litecoinSimNetParams contains parameters specific to the simulation test
// network.
var litecoinSimNetParams = litecoinNetParams{
Params: &litecoinCfg.SimNetParams,
rpcPort: "18556",
CoinType: keychain.CoinTypeTestnet,
}

// regTestNetParams contains parameters specific to a local regtest network.
var regTestNetParams = bitcoinNetParams{
Params: &bitcoinCfg.RegressionNetParams,
Expand Down
12 changes: 4 additions & 8 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,6 @@ func loadConfig() (*config, error) {
"litecoin.active must be set to 1 (true)", funcName)

case cfg.Litecoin.Active:
if cfg.Litecoin.SimNet {
str := "%s: simnet mode for litecoin not currently supported"
return nil, fmt.Errorf(str, funcName)
}
if cfg.Litecoin.RegTest {
str := "%s: regnet mode for litecoin not currently supported"
return nil, fmt.Errorf(str, funcName)
Expand All @@ -563,6 +559,10 @@ func loadConfig() (*config, error) {
// while we're at it.
numNets := 0
var ltcParams litecoinNetParams
if cfg.Litecoin.SimNet {
numNets++
ltcParams = litecoinSimNetParams
}
if cfg.Litecoin.MainNet {
numNets++
ltcParams = litecoinMainNetParams
Expand Down Expand Up @@ -611,10 +611,6 @@ func loadConfig() (*config, error) {
return nil, err
}
case "litecoind":
if cfg.Litecoin.SimNet {
return nil, fmt.Errorf("%s: litecoind does not "+
"support simnet", funcName)
}
err := parseRPCParams(cfg.Litecoin, cfg.LitecoindMode,
litecoinChain, funcName)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion lnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func lndMain() error {
case cfg.Bitcoin.MainNet || cfg.Litecoin.MainNet:
network = "mainnet"

case cfg.Bitcoin.SimNet:
case cfg.Bitcoin.SimNet || cfg.Litecoin.SimNet:
network = "simnet"

case cfg.Bitcoin.RegTest:
Expand Down