public static DecodeBlock ( |
||
reader | ||
return | BitSharp.Core.Domain.Block |
public static Block DecodeBlock(BinaryReader reader)
{
var header = DecodeBlockHeader(null, reader.ReadExactly(80));
var blockTxesCount = reader.ReadVarInt().ToIntChecked();
var blockTxes = ImmutableArray.CreateBuilder<BlockTx>(blockTxesCount);
for (var i = 0; i < blockTxesCount; i++)
{
var txBytes = ReadTransaction(reader);
var encodedTx = DecodeEncodedTx(null, txBytes);
var blockTx = new BlockTx(i, encodedTx);
blockTxes.Add(blockTx);
}
return new Block(header, blockTxes.MoveToImmutable());
}
DataDecoder::DecodeBlock ( UInt256 blockHash, byte buffer, int offset ) : BitSharp.Core.Domain.Block |
private Block GetEntry(string name) { Block block; if (blocks.TryGetValue(name, out block)) { return(block); } var entry = zip.GetEntry(name); if (entry == null) { return(null); } using (var blockStream = entry.Open()) using (var blockReader = new BinaryReader(blockStream)) { block = DataDecoder.DecodeBlock(blockReader); } blocks[name] = block; return(block); }