public void PutStorageValue(byte[] address, DataWord key, DataWord value) { address = Wallet.ToAddAddressPrefix(address); if (GetAccount(address) != null) { Key address_key = new Key(address); VMStorage storage = null; if (this.storage_cache.ContainsKey(address_key)) { storage = this.storage_cache[address_key]; } else { storage = GetStorage(address); this.storage_cache.Add(address_key, storage); } storage.Put(key, value); } }
public DataWord GetStorageValue(byte[] address, DataWord key) { DataWord result = null; address = Wallet.ToAddAddressPrefix(address); if (GetAccount(address) != null) { Key address_key = new Key(address); VMStorage storage = null; if (this.storage_cache.ContainsKey(address_key)) { storage = this.storage_cache[address_key]; } else { storage = GetStorage(address); this.storage_cache.Add(address_key, storage); } result = storage.Get(key); } return(result); }
public VMStorage GetStorage(byte[] address) { VMStorage result = null; Key key = new Key(address); if (this.storage_cache.ContainsKey(key)) { result = this.storage_cache[key]; } else { if (this.parent != null) { VMStorage parent_storage = this.parent.GetStorage(address); result = VMConfig.EnergyLimitHardFork ? new VMStorage(parent_storage) : parent_storage; } else { result = new VMStorage(address, this.db_manager.StorageRow); } } return(result); }
public void PutStorage(Key key, VMStorage cache) { this.storage_cache.Put(key, cache); }