mirror of
https://github.com/btcsuite/btcd.git
synced 2025-03-13 11:35:52 +01:00
btcd: add TestNet4 config param
This commit is contained in:
parent
8cd111a1df
commit
f02acdcaf2
3 changed files with 16 additions and 3 deletions
|
@ -170,7 +170,8 @@ type config struct {
|
|||
SigNet bool `long:"signet" description:"Use the signet test network"`
|
||||
SigNetChallenge string `long:"signetchallenge" description:"Connect to a custom signet network defined by this challenge instead of using the global default signet test network -- Can be specified multiple times"`
|
||||
SigNetSeedNode []string `long:"signetseednode" description:"Specify a seed node for the signet network instead of using the global default signet network seed nodes"`
|
||||
TestNet3 bool `long:"testnet" description:"Use the test network"`
|
||||
TestNet3 bool `long:"testnet" description:"Use the test network (version 3)"`
|
||||
TestNet4 bool `long:"testnet4" description:"Use the test network (version 4)"`
|
||||
TorIsolation bool `long:"torisolation" description:"Enable Tor stream isolation by randomizing user credentials for each connection."`
|
||||
TrickleInterval time.Duration `long:"trickleinterval" description:"Minimum time between attempts to send new inventory to a connected peer"`
|
||||
UtxoCacheMaxSizeMiB uint `long:"utxocachemaxsize" description:"The maximum size in MiB of the UTXO cache"`
|
||||
|
@ -553,6 +554,10 @@ func loadConfig() (*config, []string, error) {
|
|||
numNets++
|
||||
activeNetParams = &testNet3Params
|
||||
}
|
||||
if cfg.TestNet4 {
|
||||
numNets++
|
||||
activeNetParams = &testNet4Params
|
||||
}
|
||||
if cfg.RegressionTest {
|
||||
numNets++
|
||||
activeNetParams = ®ressionNetParams
|
||||
|
|
|
@ -48,6 +48,14 @@ var testNet3Params = params{
|
|||
rpcPort: "18334",
|
||||
}
|
||||
|
||||
// testNet4Params contains parameters specific to the test network (version 4)
|
||||
// (wire.TestNet4). NOTE: The RPC port is intentionally different from the
|
||||
// reference implementation - see the mainNetParams comment for details.
|
||||
var testNet4Params = params{
|
||||
Params: &chaincfg.TestNet4Params,
|
||||
rpcPort: "48334",
|
||||
}
|
||||
|
||||
// simNetParams contains parameters specific to the simulation test network
|
||||
// (wire.SimNet).
|
||||
var simNetParams = params{
|
||||
|
|
|
@ -2359,7 +2359,7 @@ func handleGetInfo(s *rpcServer, cmd interface{}, closeChan <-chan struct{}) (in
|
|||
Connections: s.cfg.ConnMgr.ConnectedCount(),
|
||||
Proxy: cfg.Proxy,
|
||||
Difficulty: getDifficultyRatio(best.Bits, s.cfg.ChainParams),
|
||||
TestNet: cfg.TestNet3,
|
||||
TestNet: cfg.TestNet3 || cfg.TestNet4,
|
||||
RelayFee: cfg.minRelayTxFee.ToBTC(),
|
||||
}
|
||||
|
||||
|
@ -2414,7 +2414,7 @@ func handleGetMiningInfo(s *rpcServer, cmd interface{}, closeChan <-chan struct{
|
|||
HashesPerSec: s.cfg.CPUMiner.HashesPerSecond(),
|
||||
NetworkHashPS: networkHashesPerSec,
|
||||
PooledTx: uint64(s.cfg.TxMemPool.Count()),
|
||||
TestNet: cfg.TestNet3,
|
||||
TestNet: cfg.TestNet3 || cfg.TestNet4,
|
||||
}
|
||||
return &result, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue