Load() public method

public Load ( BinaryReader br ) : void
br System.IO.BinaryReader
return void
コード例 #1
0
        public void Load(BinaryReader br)
        {
            int version = br.ReadInt32();

            mCurrentHeight = br.ReadUInt32();

            mBlockLock.WaitOne();
            mBlocks.Clear();
            int blockCount = br.ReadInt32();

            for (int i = 0; i < blockCount; i++)
            {
                BlockHeader h = new BlockHeader();
                h.Load(br);
                Block b = new Block();
                b.mHeader = h;
                b.mHash   = Program.HashToString(h.mHash);
                mBlocks.Add(b);
            }
            mBlockLock.ReleaseMutex();
        }
コード例 #2
0
ファイル: Bitcoin.cs プロジェクト: GarageGames/Bitcoin
        public void Load(BinaryReader br)
        {
            int version = br.ReadInt32();
            mCurrentHeight = br.ReadUInt32();

            mBlockLock.WaitOne();
            mBlocks.Clear();
            int blockCount = br.ReadInt32();
            for (int i = 0; i < blockCount; i++)
            {
                BlockHeader h = new BlockHeader();
                h.Load(br);
                Block b = new Block();
                b.mHeader = h;
                b.mHash = Program.HashToString(h.mHash);
                mBlocks.Add(b);
            }
            mBlockLock.ReleaseMutex();
        }