Skip to content

Commit

Permalink
feat: move the p2chain to be boxed (#97)
Browse files Browse the repository at this point in the history
Description
---
This moves the p2pool chain to boxed so that it can move out of the
stack and onto ram
  • Loading branch information
SWvheerden authored Oct 23, 2024
1 parent 0bf5a77 commit 1cccb04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/sharechain/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ use crate::{
const LOG_TARGET: &str = "tari::p2pool::sharechain::in_memory";

pub(crate) struct InMemoryShareChain {
p2_chain: Arc<RwLock<P2Chain>>,
p2_chain: Box<Arc<RwLock<P2Chain>>>,
pow_algo: PowAlgorithm,
block_validation_params: Option<Arc<BlockValidationParams>>,
consensus_manager: ConsensusManager,
Expand All @@ -62,7 +62,7 @@ impl InMemoryShareChain {
}

Ok(Self {
p2_chain: Arc::new(RwLock::new(P2Chain::new_empty(MAX_BLOCKS_COUNT, SHARE_WINDOW))),
p2_chain: Box::new(Arc::new(RwLock::new(P2Chain::new_empty(MAX_BLOCKS_COUNT, SHARE_WINDOW)))),
pow_algo,
block_validation_params,
consensus_manager,
Expand Down

0 comments on commit 1cccb04

Please sign in to comment.