mirror of
https://github.com/Cuprate/cuprate.git
synced 2024-12-23 03:59:31 +00:00
fixes
This commit is contained in:
parent
2d2d4931f8
commit
86f2dd1586
3 changed files with 9 additions and 4 deletions
|
@ -35,7 +35,10 @@ pub enum BlockchainManagerRequest {
|
|||
Pruned,
|
||||
|
||||
/// Relay a block to the network.
|
||||
RelayBlock(Block),
|
||||
RelayBlock(
|
||||
/// This is [`Box`]ed due to `clippy::large_enum_variant`.
|
||||
Box<Block>,
|
||||
),
|
||||
|
||||
/// Is the blockchain in the middle of syncing?
|
||||
///
|
||||
|
|
|
@ -166,7 +166,7 @@ async fn submit_block(
|
|||
let block_id = hex::encode(block.hash());
|
||||
|
||||
// Attempt to relay the block.
|
||||
blockchain_manager::relay_block(&mut state.blockchain_manager, block).await?;
|
||||
blockchain_manager::relay_block(&mut state.blockchain_manager, Box::new(block)).await?;
|
||||
|
||||
Ok(SubmitBlockResponse {
|
||||
base: ResponseBase::OK,
|
||||
|
@ -1059,7 +1059,9 @@ fn add_aux_pow_inner(
|
|||
let mut slots: Box<[u32]> = vec![u32::MAX; aux_pow_len].into_boxed_slice();
|
||||
let mut slot_seen: Box<[bool]> = vec![false; aux_pow_len].into_boxed_slice();
|
||||
|
||||
for nonce in 0..u32::MAX {
|
||||
const MAX_NONCE: u32 = 65535;
|
||||
|
||||
for nonce in 0..=MAX_NONCE {
|
||||
for i in &mut slots {
|
||||
let slot_u32: u32 = todo!("const uint32_t slot = cryptonote::get_aux_slot(aux_pow[idx].first, nonce, aux_pow.size());");
|
||||
let slot = u32_to_usize(slot_u32);
|
||||
|
|
|
@ -67,7 +67,7 @@ pub(crate) async fn pruned(
|
|||
/// [`BlockchainManagerRequest::RelayBlock`]
|
||||
pub(crate) async fn relay_block(
|
||||
blockchain_manager: &mut BlockchainManagerHandle,
|
||||
block: Block,
|
||||
block: Box<Block>,
|
||||
) -> Result<(), Error> {
|
||||
let BlockchainManagerResponse::Ok = blockchain_manager
|
||||
.ready()
|
||||
|
|
Loading…
Reference in a new issue