Skip to content

Commit

Permalink
revert: Insert repeat transaction in pool
Browse files Browse the repository at this point in the history
  • Loading branch information
TheWaWaR committed Apr 13, 2019
1 parent e74668b commit 2983480
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
3 changes: 0 additions & 3 deletions shared/src/chain_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ impl<CI: ChainIndex> ChainState<CI> {

pub fn add_tx_to_pool(&self, tx: Transaction, max_cycles: Cycle) -> Result<Cycle, PoolError> {
let mut tx_pool = self.tx_pool.borrow_mut();
if tx_pool.filter.contains(&tx.hash()) {
return Err(PoolError::AlreadyInPool);
}
let short_id = tx.proposal_short_id();
let rtx = self.resolve_tx_from_pool(&tx, &tx_pool);
let verify_result = self.verify_rtx(&rtx, max_cycles);
Expand Down
4 changes: 0 additions & 4 deletions shared/src/tx_pool/pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ impl TxFilter {
pub fn insert(&mut self, hash: H256) -> bool {
self.map.insert(hash, ()).is_none()
}

pub fn contains(&self, hash: &H256) -> bool {
self.map.contains_key(&hash)
}
}

#[derive(Debug, Clone)]
Expand Down

0 comments on commit 2983480

Please sign in to comment.