Merge pull request #1475 from cfromknecht/disable-mainnet-debug-htlc

config: disable debug-htlc mode on mainnet
This commit is contained in:
Olaoluwa Osuntokun 2018-07-03 22:26:45 -05:00 committed by GitHub
commit 552a371f09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -552,6 +552,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
@ -634,6 +641,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"