mirror of
https://github.com/hinto-janai/cuprate.git
synced 2024-12-31 16:09:58 +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,
|
Pruned,
|
||||||
|
|
||||||
/// Relay a block to the network.
|
/// 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?
|
/// Is the blockchain in the middle of syncing?
|
||||||
///
|
///
|
||||||
|
|
|
@ -166,7 +166,7 @@ async fn submit_block(
|
||||||
let block_id = hex::encode(block.hash());
|
let block_id = hex::encode(block.hash());
|
||||||
|
|
||||||
// Attempt to relay the block.
|
// 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 {
|
Ok(SubmitBlockResponse {
|
||||||
base: ResponseBase::OK,
|
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 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();
|
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 {
|
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: 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);
|
let slot = u32_to_usize(slot_u32);
|
||||||
|
|
|
@ -67,7 +67,7 @@ pub(crate) async fn pruned(
|
||||||
/// [`BlockchainManagerRequest::RelayBlock`]
|
/// [`BlockchainManagerRequest::RelayBlock`]
|
||||||
pub(crate) async fn relay_block(
|
pub(crate) async fn relay_block(
|
||||||
blockchain_manager: &mut BlockchainManagerHandle,
|
blockchain_manager: &mut BlockchainManagerHandle,
|
||||||
block: Block,
|
block: Box<Block>,
|
||||||
) -> Result<(), Error> {
|
) -> Result<(), Error> {
|
||||||
let BlockchainManagerResponse::Ok = blockchain_manager
|
let BlockchainManagerResponse::Ok = blockchain_manager
|
||||||
.ready()
|
.ready()
|
||||||
|
|
Loading…
Reference in a new issue