mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-28 23:56:43 +00:00
updated type conversion point to simplify - tested flag and no-flag (default) settings
This commit is contained in:
parent
f6903b4f57
commit
5496007cba
4 changed files with 5 additions and 5 deletions
|
|
@ -758,7 +758,7 @@ var (
|
|||
TxArrivalWaitFlag = cli.IntFlag{
|
||||
Name: "txarrivalwait",
|
||||
Usage: "Maximum number of milliseconds to wait for a transaction before requesting it (defaults to 100ms)",
|
||||
Value: (int)(node.DefaultConfig.P2P.TxArrivalWait),
|
||||
Value: node.DefaultConfig.P2P.TxArrivalWait,
|
||||
}
|
||||
|
||||
// Metrics flags
|
||||
|
|
@ -1296,7 +1296,7 @@ func SetP2PConfig(ctx *cli.Context, cfg *p2p.Config) {
|
|||
}
|
||||
|
||||
if ctx.GlobalIsSet(TxArrivalWaitFlag.Name) {
|
||||
cfg.TxArrivalWait = (time.Duration)(TxArrivalWaitFlag.Value) * time.Millisecond
|
||||
cfg.TxArrivalWait = TxArrivalWaitFlag.Value
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
|||
EthAPI: ethAPI,
|
||||
PeerRequiredBlocks: config.PeerRequiredBlocks,
|
||||
checker: checker,
|
||||
txArrivalWait: eth.p2pServer.TxArrivalWait,
|
||||
txArrivalWait: time.Duration(eth.p2pServer.TxArrivalWait) * time.Millisecond,
|
||||
}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1051,7 +1051,7 @@ func (c *Config) buildNode() (*node.Config, error) {
|
|||
MaxPendingPeers: int(c.P2P.MaxPendPeers),
|
||||
ListenAddr: c.P2P.Bind + ":" + strconv.Itoa(int(c.P2P.Port)),
|
||||
DiscoveryV5: c.P2P.Discovery.V5Enabled,
|
||||
TxArrivalWait: time.Duration(c.P2P.TxArrivalWait),
|
||||
TxArrivalWait: int(c.P2P.TxArrivalWait),
|
||||
},
|
||||
HTTPModules: c.JsonRPC.Http.API,
|
||||
HTTPCors: c.JsonRPC.Http.Cors,
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ type Config struct {
|
|||
|
||||
// TxArrivalWait is the duration (ms) that the node will wait after seeing
|
||||
// an announced transaction before explicitly requesting it
|
||||
TxArrivalWait time.Duration
|
||||
TxArrivalWait int
|
||||
}
|
||||
|
||||
// Server manages all peer connections.
|
||||
|
|
|
|||
Loading…
Reference in a new issue