public CanonicalBlockHashCache(ILightChain lightChain, ILogger logger = null) { _lightChain = lightChain; _logger = logger; MessageHub.Instance.Subscribe <BlockHeader>( async h => await OnNewBlockHeader(h)); MessageHub.Instance.Subscribe <BranchRolledBack>( async r => await RecoverCurrent()); }
public void Init(Hash chainId) { LightChain = _chainService.GetLightChain(chainId); }