mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-10-14 00:59:33 +00:00
[DEV-325] Add SubNetwork command-line and config flag (#135)
* [DEV-325] Added subnetwork cmd/config flag * [DEV-325] Fixed subnetwork comments
This commit is contained in:
parent
4a6fd8fad1
commit
6d035fce29
@ -165,6 +165,7 @@ type configFlags struct {
|
|||||||
DropAddrIndex bool `long:"dropaddrindex" description:"Deletes the address-based transaction index from the database on start up and then exits."`
|
DropAddrIndex bool `long:"dropaddrindex" description:"Deletes the address-based transaction index from the database on start up and then exits."`
|
||||||
RelayNonStd bool `long:"relaynonstd" description:"Relay non-standard transactions regardless of the default settings for the active network."`
|
RelayNonStd bool `long:"relaynonstd" description:"Relay non-standard transactions regardless of the default settings for the active network."`
|
||||||
RejectNonStd bool `long:"rejectnonstd" description:"Reject non-standard transactions regardless of the default settings for the active network."`
|
RejectNonStd bool `long:"rejectnonstd" description:"Reject non-standard transactions regardless of the default settings for the active network."`
|
||||||
|
SubNetwork uint64 `long:"subnetwork" description:"If subnetwork > 0, than node will request and process only payloads from specified subnetwork. And if subnetwork is 0, than payloads of all subnetworks are processed."`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Config defines the configuration options for btcd.
|
// Config defines the configuration options for btcd.
|
||||||
@ -750,6 +751,15 @@ func loadConfig() (*Config, []string, error) {
|
|||||||
cfg.MiningAddrs = append(cfg.MiningAddrs, addr)
|
cfg.MiningAddrs = append(cfg.MiningAddrs, addr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check that 'generate' and 'subnetwork' flags do not conflict
|
||||||
|
if cfg.Generate && cfg.SubNetwork != 0 {
|
||||||
|
str := "%s: both generate flag and subnetwork filtering are set "
|
||||||
|
err := fmt.Errorf(str, funcName)
|
||||||
|
fmt.Fprintln(os.Stderr, err)
|
||||||
|
fmt.Fprintln(os.Stderr, usageMessage)
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
|
||||||
// Ensure there is at least one mining address when the generate flag is
|
// Ensure there is at least one mining address when the generate flag is
|
||||||
// set.
|
// set.
|
||||||
if cfg.Generate && len(cfg.MiningAddrs) == 0 {
|
if cfg.Generate && len(cfg.MiningAddrs) == 0 {
|
||||||
|
@ -343,3 +343,12 @@
|
|||||||
; be disabled if this option is not specified. The profile information can be
|
; be disabled if this option is not specified. The profile information can be
|
||||||
; accessed at http://localhost:<profileport>/debug/pprof once running.
|
; accessed at http://localhost:<profileport>/debug/pprof once running.
|
||||||
; profile=6061
|
; profile=6061
|
||||||
|
|
||||||
|
; ------------------------------------------------------------------------------
|
||||||
|
; Subnetworks
|
||||||
|
; ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
; If subnetwork > 0, than node will request and process only payloads from
|
||||||
|
; specified subnetwork. And if subnetwork is 0, than payloads of all subnetworks
|
||||||
|
; are processed. It also requires that generate flag will be false.
|
||||||
|
; subnetwork=0
|
Loading…
x
Reference in New Issue
Block a user