Skip to content

Commit

Permalink
config: Experimental support for Litecoin/simnet
Browse files Browse the repository at this point in the history
This PR adds the configuration needed to run LND with Litecoin on simnet. The change is minimal and has no impact for users that don't enable this mode. When using this configuration, the user is being warned that this mode is not officially supported.
  • Loading branch information
Offer Markovich authored and Offer Markovich committed Sep 14, 2018
1 parent 48d016b commit 28213b7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
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

0 comments on commit 28213b7

Please sign in to comment.