Ejemplo n.º 1
0
        public BlockDiscStorage(Base.Storage storage, ChainType chainType, int chainId, uint chainIndex, long sliceIndex, bool readOnly) : base(storage, Path.Combine(BlockStorage.GetBlockStoragePath(chainType, chainId, chainIndex), sliceIndex.ToString()), 256, 32, DiscStorageFlags.AppendOnly | DiscStorageFlags.DynamicBlockSize | (readOnly ? DiscStorageFlags.Readonly : DiscStorageFlags.None))
        {
            SliceIndex = sliceIndex;

            if (UserDataUnpacker.UnpackBool())
            {
                UserDataUnpacker.UnpackUshort();
            }
        }
Ejemplo n.º 2
0
 public MetaDiscStorage(Base.Storage storage, ChainType chainType, int chainId, uint chainIndex, string name, int blockSize, DiscStorageFlags flags, int userDataSize = 20) : base(storage, Path.Combine(Chain.GetChainMetaDirectory(chainType, chainId, chainIndex), name), blockSize, userDataSize, flags)
 {
     if (UserDataUnpacker.UnpackBool())
     {
         LastBlockId       = UserDataUnpacker.UnpackLong();
         LastTransactionId = UserDataUnpacker.UnpackLong();
         MetaUnpack();
     }
 }
 public TransactionDiscStorage(Base.Storage storage, string name, int blockSize, DiscStorageFlags flags) : base(storage, name, blockSize, 32, flags)
 {
     if (UserDataUnpacker.UnpackBool())
     {
         UserDataUnpacker.UnpackUshort();
         FirstBlockId = UserDataUnpacker.UnpackLong();
         LastBlockId  = UserDataUnpacker.UnpackLong();
         Split        = UserDataUnpacker.UnpackBool();
     }
 }
Ejemplo n.º 4
0
 protected override void MetaUnpack()
 {
     base.MetaUnpack();
     LastAvailableTick = UserDataUnpacker.UnpackInt();
     LastProcessedTick = UserDataUnpacker.UnpackInt();
 }