From 7d116abedbc3c9311df4cefce7b1e633399c98e6 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Fri, 29 Jun 2018 14:04:42 -0700 Subject: [PATCH] config: disable debug-htlc mode on mainnet --- config.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/config.go b/config.go index 949f25037..b0092666d 100644 --- a/config.go +++ b/config.go @@ -548,6 +548,13 @@ func loadConfig() (*config, error) { return nil, err } + if cfg.Litecoin.MainNet && cfg.DebugHTLC { + str := "%s: debug-htlc mode cannot be used " + + "on litecoin mainnet" + err := fmt.Errorf(str, funcName) + return nil, err + } + // The litecoin chain is the current active chain. However // throughout the codebase we required chaincfg.Params. So as a // temporary hack, we'll mutate the default net params for @@ -630,6 +637,13 @@ func loadConfig() (*config, error) { return nil, err } + if cfg.Bitcoin.MainNet && cfg.DebugHTLC { + str := "%s: debug-htlc mode cannot be used " + + "on bitcoin mainnet" + err := fmt.Errorf(str, funcName) + return nil, err + } + if cfg.Bitcoin.Node == "neutrino" && cfg.Bitcoin.MainNet { str := "%s: neutrino isn't yet supported for " + "bitcoin's mainnet"