Merge pull request #1865 from ExchangeUnion/litecoin-simnet

config: Experimental support for Litecoin/simnet
This commit is contained in:
Conner Fromknecht 2019-04-19 14:43:47 -07:00 committed by GitHub
commit ab4a6750cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 5 deletions

@ -54,6 +54,14 @@ var bitcoinSimNetParams = bitcoinNetParams{
CoinType: keychain.CoinTypeTestnet, 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 // litecoinTestNetParams contains parameters specific to the 4th version of the
// test network. // test network.
var litecoinTestNetParams = litecoinNetParams{ var litecoinTestNetParams = litecoinNetParams{

@ -591,10 +591,6 @@ func loadConfig() (*config, error) {
"litecoin.active must be set to 1 (true)", funcName) "litecoin.active must be set to 1 (true)", funcName)
case cfg.Litecoin.Active: 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 { if cfg.Litecoin.RegTest {
str := "%s: regnet mode for litecoin not currently supported" str := "%s: regnet mode for litecoin not currently supported"
return nil, fmt.Errorf(str, funcName) return nil, fmt.Errorf(str, funcName)
@ -618,6 +614,10 @@ func loadConfig() (*config, error) {
numNets++ numNets++
ltcParams = litecoinTestNetParams ltcParams = litecoinTestNetParams
} }
if cfg.Litecoin.SimNet {
numNets++
ltcParams = litecoinSimNetParams
}
if numNets > 1 { if numNets > 1 {
str := "%s: The mainnet, testnet, and simnet params " + str := "%s: The mainnet, testnet, and simnet params " +
"can't be used together -- choose one of the " + "can't be used together -- choose one of the " +

2
lnd.go

@ -119,7 +119,7 @@ func lndMain() error {
case cfg.Bitcoin.MainNet || cfg.Litecoin.MainNet: case cfg.Bitcoin.MainNet || cfg.Litecoin.MainNet:
network = "mainnet" network = "mainnet"
case cfg.Bitcoin.SimNet: case cfg.Bitcoin.SimNet || cfg.Litecoin.SimNet:
network = "simnet" network = "simnet"
case cfg.Bitcoin.RegTest: case cfg.Bitcoin.RegTest: