config: disable debug-htlc mode on mainnet

This commit is contained in:
Conner Fromknecht 2018-06-29 14:04:42 -07:00
parent 9205720bea
commit 7d116abedb
No known key found for this signature in database
GPG Key ID: 39DE78FBE6ACB0EF

@ -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"