add litecoin regtest configuration to lnd
regtest change to chainregistry for default port number merge w/ master
This commit is contained in:
parent
42b081bb37
commit
6fd5ef88b6
@ -78,8 +78,17 @@ var litecoinMainNetParams = litecoinNetParams{
|
||||
CoinType: keychain.CoinTypeLitecoin,
|
||||
}
|
||||
|
||||
// regTestNetParams contains parameters specific to a local regtest network.
|
||||
var regTestNetParams = bitcoinNetParams{
|
||||
// litecoinRegTestNetParams contains parameters specific to a local litecoin
|
||||
// regtest network.
|
||||
var litecoinRegTestNetParams = litecoinNetParams{
|
||||
Params: &litecoinCfg.RegressionNetParams,
|
||||
rpcPort: "18334",
|
||||
CoinType: keychain.CoinTypeTestnet,
|
||||
}
|
||||
|
||||
// bitcoinRegTestNetParams contains parameters specific to a local bitcoin
|
||||
// regtest network.
|
||||
var bitcoinRegTestNetParams = bitcoinNetParams{
|
||||
Params: &bitcoinCfg.RegressionNetParams,
|
||||
rpcPort: "18334",
|
||||
CoinType: keychain.CoinTypeTestnet,
|
||||
|
@ -256,10 +256,15 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
|
||||
rpcPort -= 2
|
||||
bitcoindHost = fmt.Sprintf("%v:%d",
|
||||
bitcoindMode.RPCHost, rpcPort)
|
||||
if cfg.Bitcoin.Active && cfg.Bitcoin.RegTest {
|
||||
if (cfg.Bitcoin.Active && cfg.Bitcoin.RegTest) ||
|
||||
(cfg.Litecoin.Active && cfg.Litecoin.RegTest) {
|
||||
conn, err := net.Dial("tcp", bitcoindHost)
|
||||
if err != nil || conn == nil {
|
||||
if cfg.Bitcoin.Active && cfg.Bitcoin.RegTest {
|
||||
rpcPort = 18443
|
||||
} else if cfg.Litecoin.Active && cfg.Litecoin.RegTest {
|
||||
rpcPort = 19443
|
||||
}
|
||||
bitcoindHost = fmt.Sprintf("%v:%d",
|
||||
bitcoindMode.RPCHost,
|
||||
rpcPort)
|
||||
@ -320,7 +325,7 @@ func newChainControlFromConfig(cfg *config, chanDB *channeldb.DB,
|
||||
if err := cc.feeEstimator.Start(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
} else if cfg.Litecoin.Active {
|
||||
} else if cfg.Litecoin.Active && !cfg.Litecoin.RegTest {
|
||||
ltndLog.Infof("Initializing litecoind backed fee estimator")
|
||||
|
||||
// Finally, we'll re-initialize the fee estimator, as
|
||||
|
17
config.go
17
config.go
@ -591,16 +591,10 @@ func loadConfig() (*config, error) {
|
||||
"litecoin.active must be set to 1 (true)", funcName)
|
||||
|
||||
case cfg.Litecoin.Active:
|
||||
if cfg.Litecoin.RegTest {
|
||||
str := "%s: regnet mode for litecoin not currently supported"
|
||||
return nil, fmt.Errorf(str, funcName)
|
||||
}
|
||||
|
||||
if cfg.Litecoin.TimeLockDelta < minTimeLockDelta {
|
||||
return nil, fmt.Errorf("timelockdelta must be at least %v",
|
||||
minTimeLockDelta)
|
||||
}
|
||||
|
||||
// Multiple networks can't be selected simultaneously. Count
|
||||
// number of network flags passed; assign active network params
|
||||
// while we're at it.
|
||||
@ -618,6 +612,15 @@ func loadConfig() (*config, error) {
|
||||
numNets++
|
||||
ltcParams = litecoinSimNetParams
|
||||
}
|
||||
if cfg.Litecoin.RegTest {
|
||||
numNets++
|
||||
ltcParams = litecoinRegTestNetParams
|
||||
}
|
||||
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 " +
|
||||
@ -700,7 +703,7 @@ func loadConfig() (*config, error) {
|
||||
}
|
||||
if cfg.Bitcoin.RegTest {
|
||||
numNets++
|
||||
activeNetParams = regTestNetParams
|
||||
activeNetParams = bitcoinRegTestNetParams
|
||||
}
|
||||
if cfg.Bitcoin.SimNet {
|
||||
numNets++
|
||||
|
2
lnd.go
2
lnd.go
@ -123,7 +123,7 @@ func Main() error {
|
||||
case cfg.Bitcoin.SimNet || cfg.Litecoin.SimNet:
|
||||
network = "simnet"
|
||||
|
||||
case cfg.Bitcoin.RegTest:
|
||||
case cfg.Bitcoin.RegTest || cfg.Litecoin.RegTest:
|
||||
network = "regtest"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user