public void StartBlockChainDownload(IPeerEventListener listener)
{
lock (this)
{
_downloadListener = listener;
// TODO be more nuanced about which peer to download from. We can also try
// downloading from multiple peers and handle the case when a new peer comes along
// with a longer chain after we thought we were done.
lock (_peers)
{
var firstPeer = _peers.FirstOrDefault();
if (firstPeer != null)
StartBlockChainDownloadFromPeer(firstPeer);
}
}
}