Exemplo n.º 1
0
 public DbCache(LTLightDB db, LTISnapShot snapshot, LTWriteTask batch, byte prefix)
 {
     this.db       = db;
     this.snapshot = snapshot ?? db.UseSnapShot();
     this.batch    = batch;
     this.prefix   = prefix;
 }
Exemplo n.º 2
0
 public DbMetaDataCache(LTLightDB db, LTISnapShot snapshot, LTWriteTask batch, byte prefix, Func <T> factory = null)
     : base(factory)
 {
     this.db       = db;
     this.snapshot = snapshot ?? db.UseSnapShot();
     this.batch    = batch;
     this.prefix   = prefix;
 }
Exemplo n.º 3
0
 public DbCache(DB db, LTISnapshot _snapshot, LTWriteTask batch, byte prefix)
 {
     this.db      = db;
     snapshot     = _snapshot ?? db.UseSnapShot();
     this.options = options ?? ReadOptions.Default;
     this.batch   = batch;
     this.prefix  = prefix;
 }
Exemplo n.º 4
0
 public DbSnapshot(DB db)
 {
     this.db         = db;
     this.snapshot   = db.UseSnapShot();
     this.batch      = db.CreateWriteTask();
     Blocks          = new DbCache <UInt256, BlockState>(db, snapshot, batch, Prefixes.DATA_Block);
     Transactions    = new DbCache <UInt256, TransactionState>(db, snapshot, batch, Prefixes.DATA_Transaction);
     Accounts        = new DbCache <UInt160, AccountState>(db, snapshot, batch, Prefixes.ST_Account);
     UnspentCoins    = new DbCache <UInt256, UnspentCoinState>(db, snapshot, batch, Prefixes.ST_Coin);
     SpentCoins      = new DbCache <UInt256, SpentCoinState>(db, snapshot, batch, Prefixes.ST_SpentCoin);
     Validators      = new DbCache <ECPoint, ValidatorState>(db, snapshot, batch, Prefixes.ST_Validator);
     Assets          = new DbCache <UInt256, AssetState>(db, snapshot, batch, Prefixes.ST_Asset);
     Contracts       = new DbCache <UInt160, ContractState>(db, snapshot, batch, Prefixes.ST_Contract);
     Storages        = new DbCache <StorageKey, StorageItem>(db, snapshot, batch, Prefixes.ST_Storage);
     HeaderHashList  = new DbCache <UInt32Wrapper, HeaderHashList>(db, snapshot, batch, Prefixes.IX_HeaderHashList);
     ValidatorsCount = new DbMetaDataCache <ValidatorsCountState>(db, snapshot, batch, Prefixes.IX_ValidatorsCount);
     BlockHashIndex  = new DbMetaDataCache <HashIndexState>(db, snapshot, batch, Prefixes.IX_CurrentBlock);
     HeaderHashIndex = new DbMetaDataCache <HashIndexState>(db, snapshot, batch, Prefixes.IX_CurrentHeader);
 }