mirror of
https://github.com/lightningnetwork/lnd.git
synced 2026-08-13 12:32:48 +02:00
lncfg: add IsLocalNetwork helper
It returns true for Signet and Regtest networks.
This commit is contained in:
parent
c7aa17971b
commit
04564977d8
2 changed files with 8 additions and 2 deletions
|
|
@ -528,7 +528,7 @@ func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) {
|
|||
// On local test networks we usually don't have multiple
|
||||
// chain backend peers, so we can skip
|
||||
// the checkOutboundPeers test.
|
||||
if cfg.Bitcoin.SimNet || cfg.Bitcoin.RegTest {
|
||||
if cfg.Bitcoin.IsLocalNetwork() {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
@ -651,7 +651,7 @@ func NewPartialChainControl(cfg *Config) (*PartialChainControl, func(), error) {
|
|||
// On local test networks we usually don't have multiple
|
||||
// chain backend peers, so we can skip
|
||||
// the checkOutboundPeers test.
|
||||
if cfg.Bitcoin.SimNet || cfg.Bitcoin.RegTest {
|
||||
if cfg.Bitcoin.IsLocalNetwork() {
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,3 +52,9 @@ func (c *Chain) Validate(minTimeLockDelta uint32, minDelay uint16) error {
|
|||
|
||||
return nil
|
||||
}
|
||||
|
||||
// IsLocalNetwork returns true if the chain is a local network, such as
|
||||
// simnet or regtest.
|
||||
func (c *Chain) IsLocalNetwork() bool {
|
||||
return c.SimNet || c.RegTest
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue