lnd+config: add flags for mainnet

This commit is contained in:
Olaoluwa Osuntokun
2018-03-15 02:04:17 -07:00
parent c00880144c
commit 71a5fac9c7
2 changed files with 85 additions and 10 deletions

21
lnd.go
View File

@@ -23,6 +23,7 @@ import (
"path/filepath"
"runtime"
"runtime/pprof"
"strings"
"sync"
"time"
@@ -105,6 +106,26 @@ func lndMain() error {
// Show version at startup.
ltndLog.Infof("Version %s", version())
var network string
switch {
case cfg.Bitcoin.TestNet3 || cfg.Litecoin.TestNet3:
network = "testnet"
case cfg.Bitcoin.MainNet || cfg.Litecoin.MainNet:
network = "mainnet"
case cfg.Bitcoin.SimNet:
network = "simmnet"
case cfg.Bitcoin.RegTest:
network = "regtest"
}
ltndLog.Infof("Active chain: %v (network=%v)",
strings.Title(registeredChains.PrimaryChain().String()),
network,
)
// Enable http profiling server if requested.
if cfg.Profile != "" {
go func() {