|
|
@ -36,15 +36,16 @@ type ( |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
// NewDownloader creates a new downloader
|
|
|
|
// NewDownloader creates a new downloader
|
|
|
|
func NewDownloader(host p2p.Host, bc core.BlockChain, config Config) *Downloader { |
|
|
|
func NewDownloader(host p2p.Host, bc core.BlockChain, isBeaconNode bool, config Config) *Downloader { |
|
|
|
config.fixValues() |
|
|
|
config.fixValues() |
|
|
|
|
|
|
|
|
|
|
|
sp := sync.NewProtocol(sync.Config{ |
|
|
|
sp := sync.NewProtocol(sync.Config{ |
|
|
|
Chain: bc, |
|
|
|
Chain: bc, |
|
|
|
Host: host.GetP2PHost(), |
|
|
|
Host: host.GetP2PHost(), |
|
|
|
Discovery: host.GetDiscovery(), |
|
|
|
Discovery: host.GetDiscovery(), |
|
|
|
ShardID: nodeconfig.ShardID(bc.ShardID()), |
|
|
|
ShardID: nodeconfig.ShardID(bc.ShardID()), |
|
|
|
Network: config.Network, |
|
|
|
Network: config.Network, |
|
|
|
|
|
|
|
BeaconNode: isBeaconNode, |
|
|
|
|
|
|
|
|
|
|
|
SmSoftLowCap: config.SmSoftLowCap, |
|
|
|
SmSoftLowCap: config.SmSoftLowCap, |
|
|
|
SmHardLowCap: config.SmHardLowCap, |
|
|
|
SmHardLowCap: config.SmHardLowCap, |
|
|
|