Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reinsert transactions from failed block #4675

Merged
Merged
15 changes: 13 additions & 2 deletions base_layer/core/src/mempool/mempool_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,21 @@ impl MempoolStorage {
failed_block.header.height,
failed_block.hash().to_hex()
);
self.unconfirmed_pool
let txs = self
.unconfirmed_pool
.remove_published_and_discard_deprecated_transactions(failed_block);

// Reinsert them to validate if they are still valid
for tx in txs {
let _result = self.insert(tx).map_err(|e| {
warn!(
target: LOG_TARGET,
"Discarding transaction because it is no longer valid: {}", e
);
});
}
self.unconfirmed_pool.compact();
debug!(target: LOG_TARGET, "{}", self.stats());

Ok(())
}

Expand Down