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

config: Experimental support for Litecoin/simnet #1865

Merged
merged 1 commit into from
Apr 19, 2019
Merged
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 @@ -54,6 +54,14 @@ var bitcoinSimNetParams = bitcoinNetParams{
CoinType: keychain.CoinTypeTestnet,
}

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

// litecoinTestNetParams contains parameters specific to the 4th version of the
// test network.
var litecoinTestNetParams = litecoinNetParams{
Expand Down
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,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 @@ -568,6 +564,10 @@ func loadConfig() (*config, error) {
numNets++
ltcParams = litecoinTestNetParams
}
if cfg.Litecoin.SimNet {
numNets++
ltcParams = litecoinSimNetParams
}
if numNets > 1 {
str := "%s: The mainnet, testnet, and simnet params " +
"can't be used together -- choose one of the " +
Expand Down
2 changes: 1 addition & 1 deletion lnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,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