public void Load(string blockFolder) { var store = new NBitcoin.BitcoinCore.BlockStore(blockFolder, this._Tester.Client.Configuration.Network); foreach (var block in store.Enumerate(false)) { SubmitBlock(block.Item); } }
public async Task <BlockHeader> GetHeaderAsync(uint256 hash) { var pos = await Index.GetAsync <DiskBlockPos>(hash.ToString()).ConfigureAwait(false); if (pos == null) { return(null); } var stored = _Store.Enumerate(false, new DiskBlockPosRange(pos)).FirstOrDefault(); if (stored == null) { return(null); } return(stored.Item.Header); }
public async Task <BlockHeader> GetHeaderAsync(uint256 hash) { var pos = await Index.GetAsync <DiskBlockPos>(hash.ToString()).ConfigureAwait(false); if (pos == null) { return(null); } #pragma warning disable CS0612 // Type or member is obsolete var stored = _Store.Enumerate(false, new DiskBlockPosRange(pos)).FirstOrDefault(); #pragma warning restore CS0612 // Type or member is obsolete if (stored == null) { return(null); } return(stored.Item.Header); }