Skip to content

Commit

Permalink
refactor: base on reviews
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroqn committed Dec 12, 2021
1 parent 6ad7c5d commit ccd427c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion crates/mem-pool/src/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ impl MemPool {
self.mem_block.txs().len().saturating_add(expect_slots) > MAX_MEM_BLOCK_TXS
}

pub fn pending_restored_txc_hashes(&mut self) -> &mut Vec<H256> {
pub fn pending_restored_tx_hashes(&mut self) -> &mut Vec<H256> {
&mut self.pending_restored_tx_hashes
}

Expand Down
6 changes: 2 additions & 4 deletions crates/rpc-server/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ impl RequestSubmitter {

log::info!(
"reinject mem block txs {}",
mem_pool.pending_restored_txc_hashes().len()
mem_pool.pending_restored_tx_hashes().len()
);
while let Some(hash) = mem_pool.pending_restored_txc_hashes().last().cloned() {
while let Some(hash) = mem_pool.pending_restored_tx_hashes().pop() {
match db.get_mem_pool_transaction(&hash) {
Ok(Some(tx)) => {
if let Err(err) = mem_pool.push_transaction(tx) {
Expand All @@ -362,8 +362,6 @@ impl RequestSubmitter {
log::error!("reinject mem block tx {} err {}", hash.pack(), err);
}
}

mem_pool.pending_restored_txc_hashes().pop();
}
}

Expand Down

0 comments on commit ccd427c

Please sign in to comment.