{
try
{
- ByteQueue wBytes = new ByteQueue(ref blockBytes);
+ var stream = new MemoryStream(blockBytes);
+ var reader = new BinaryReader(stream);
// Fill the block header fields
- header = new CBlockHeader(wBytes.Get(80));
+ header = new CBlockHeader(ref reader);
// Parse transactions list
- vtx = CTransaction.ReadTransactionsList(ref wBytes);
+ vtx = CTransaction.ReadTransactionsList(ref reader);
// Read block signature
- signature = wBytes.Get((int)wBytes.GetVarInt());
+ signature = reader.ReadBytes((int)VarInt.ReadVarInt(ref reader));
+
+ reader.Close();
}
catch (Exception e)
{