nimbus-eth1/fluffy/network/wire/portal_protocol_config.nim

27 lines
559 B
Nim

import
eth/p2p/discoveryv5/routing_table
type
PortalProtocolConfig* = object
tableIpLimits*: TableIpLimits
bitsPerHop*: int
const
defaultPortalProtocolConfig* = PortalProtocolConfig(
tableIpLimits: DefaultTableIpLimits,
bitsPerHop: DefaultBitsPerHop)
proc init*(
T: type PortalProtocolConfig,
tableIpLimit: uint,
bucketIpLimit: uint,
bitsPerHop: int): T =
PortalProtocolConfig(
tableIpLimits: TableIpLimits(
tableIpLimit: tableIpLimit,
bucketIpLimit: bucketIpLimit),
bitsPerHop: bitsPerHop
)