Skip to content

Commit

Permalink
mempool: sizes fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michalkucharczyk committed Nov 29, 2024
1 parent 7734748 commit e1dce5a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,14 @@ where
tx: TxInMemPool<ChainApi, Block>,
tx_to_be_removed: Option<ExtrinsicHash<ChainApi>>,
) -> Result<InsertionInfo<ExtrinsicHash<ChainApi>>, sc_transaction_pool_api::error::Error> {
let bytes = self.transactions.bytes();
let mut transactions = self.transactions.write();

tx_to_be_removed.inspect(|hash| {
transactions.remove(hash);
});

let bytes = self.transactions.bytes();

let result = match (
self.is_limit_exceeded(transactions.len() + 1, bytes + tx.bytes),
transactions.contains_key(&hash),
Expand Down

0 comments on commit e1dce5a

Please sign in to comment.