Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit 666b0be

Browse files
committed
Renamed pending to buffered
1 parent ab7c600 commit 666b0be

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ethcore/src/state_db.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ struct AccountCache {
4343
modifications: VecDeque<BlockChanges>,
4444
}
4545

46-
/// Pending account cache item.
46+
/// Buffered account cache item.
4747
struct CacheQueueItem {
4848
/// Account address.
4949
address: Address,
@@ -80,8 +80,8 @@ pub struct StateDB {
8080
db: Box<JournalDB>,
8181
/// Shared canonical state cache.
8282
account_cache: Arc<Mutex<AccountCache>>,
83-
/// Local pending cache changes.
84-
pending_cache: Vec<CacheQueueItem>,
83+
/// Local cache buffer.
84+
cache_buffer: Vec<CacheQueueItem>,
8585
/// Shared account bloom. Does not handle chain reorganizations.
8686
account_bloom: Arc<Mutex<Bloom>>,
8787
/// Hash of the block on top of which this instance was created or
@@ -130,7 +130,7 @@ impl StateDB {
130130
accounts: LruCache::new(STATE_CACHE_ITEMS),
131131
modifications: VecDeque::new(),
132132
})),
133-
pending_cache: Vec::new(),
133+
cache_buffer: Vec::new(),
134134
account_bloom: Arc::new(Mutex::new(bloom)),
135135
parent_hash: None,
136136
commit_hash: None,
@@ -177,7 +177,7 @@ impl StateDB {
177177
Ok(records)
178178
}
179179

180-
/// Apply pending cache changes and synchronize canonical
180+
/// Apply buffered cache changes and synchronize canonical
181181
/// state cache with the best block state.
182182
/// This function updates the cache by removing entries that are
183183
/// invalidated by chain reorganization. `update_cache` should be
@@ -236,8 +236,8 @@ impl StateDB {
236236
cache.modifications.pop_back();
237237
}
238238
let mut modifications = HashSet::new();
239-
trace!("committing {} cache entries", self.pending_cache.len());
240-
for account in self.pending_cache.drain(..) {
239+
trace!("committing {} cache entries", self.cache_buffer.len());
240+
for account in self.cache_buffer.drain(..) {
241241
if account.modified {
242242
modifications.insert(account.address.clone());
243243
}
@@ -287,7 +287,7 @@ impl StateDB {
287287
StateDB {
288288
db: self.db.boxed_clone(),
289289
account_cache: self.account_cache.clone(),
290-
pending_cache: Vec::new(),
290+
cache_buffer: Vec::new(),
291291
account_bloom: self.account_bloom.clone(),
292292
parent_hash: None,
293293
commit_hash: None,
@@ -300,7 +300,7 @@ impl StateDB {
300300
StateDB {
301301
db: self.db.boxed_clone(),
302302
account_cache: self.account_cache.clone(),
303-
pending_cache: Vec::new(),
303+
cache_buffer: Vec::new(),
304304
account_bloom: self.account_bloom.clone(),
305305
parent_hash: Some(parent.clone()),
306306
commit_hash: None,
@@ -326,7 +326,7 @@ impl StateDB {
326326
/// Add pending cache change.
327327
/// The change is queued to be applied in `commit`.
328328
pub fn add_to_account_cache(&mut self, addr: Address, data: Option<Account>, modified: bool) {
329-
self.pending_cache.push(CacheQueueItem {
329+
self.cache_buffer.push(CacheQueueItem {
330330
address: addr,
331331
account: data,
332332
modified: modified,

0 commit comments

Comments
 (0)