Skip to content

Commit

Permalink
finish mempool side
Browse files Browse the repository at this point in the history
  • Loading branch information
SWvheerden committed Sep 22, 2022
1 parent b9f1f5b commit 9a2c0aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions base_layer/core/src/mempool/mempool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ impl Mempool {
}

/// After a sync event, we can move all orphan transactions to the unconfirmed pool after validation
pub async fn process_sync(&self, blocks_added: u64) -> Result<(), MempoolError> {
self.with_write_access(move |storage| storage.process_sync(blocks_added))
pub async fn process_sync(&self) -> Result<(), MempoolError> {
self.with_write_access(move |storage| storage.process_sync())
.await
}

Expand Down
2 changes: 1 addition & 1 deletion base_layer/core/src/mempool/mempool_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ impl MempoolStorage {
}

/// After a sync event, we need to try to add in all the transaction form the reorg pool.
pub fn process_sync(&mut self, blocks_added: u64) -> Result<(), MempoolError> {
pub fn process_sync(&mut self) -> Result<(), MempoolError> {
debug!(target: LOG_TARGET, "Mempool processing sync finished");
// lets remove and revalidate all transactions from the mempool. All we know is that the state has changed, but
// we dont have the data to know what.
Expand Down
5 changes: 2 additions & 3 deletions base_layer/core/src/mempool/service/inbound_handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,8 @@ impl MempoolInboundHandlers {
},
ValidBlockAdded(_, _) => {},
BlockSyncRewind(_) => {},
BlockSyncComplete(tip_block, starting_sync_height) => {
let height_diff = tip_block.height() - starting_sync_height;
self.mempool.process_sync(height_diff).await?;
BlockSyncComplete(_,_) => {
self.mempool.process_sync().await?;
},
AddBlockValidationFailed {
block: failed_block,
Expand Down

0 comments on commit 9a2c0aa

Please sign in to comment.