fix merge

This commit is contained in:
Boog900 2024-10-14 21:02:47 +01:00
parent bb7126bd96
commit dc482558db
No known key found for this signature in database
GPG key ID: 42AB1287CB0041C2
4 changed files with 18 additions and 18 deletions

View file

@ -245,21 +245,13 @@ async fn new_fluffy_block(
.take_normal()
.ok_or(anyhow::anyhow!("Peer sent pruned txs in fluffy block"))?;
let mut txs_in_block = block.transactions.iter().copied().collect::<HashSet<_>>();
// TODO: size check these tx blobs
let txs = tx_blobs
.into_iter()
.map(|tx_blob| {
let tx = Transaction::read(&mut tx_blob.as_ref())?;
let tx = new_tx_verification_data(tx)?;
if !txs_in_block.remove(&tx.tx_hash) {
anyhow::bail!("Peer sent tx in fluffy block that wasn't actually in block")
}
Ok((tx.tx_hash, tx))
Ok(tx)
})
.collect::<Result<_, anyhow::Error>>()?;

View file

@ -22,12 +22,12 @@ use rayon::{
};
use thread_local::ThreadLocal;
use cuprate_database::{ConcreteEnv, DatabaseRo, Env, EnvInner, RuntimeError};
use cuprate_database::{ConcreteEnv, DatabaseIter, DatabaseRo, Env, EnvInner, RuntimeError};
use cuprate_database_service::{init_thread_pool, DatabaseReadService, ReaderThreads};
use cuprate_helper::map::combine_low_high_bits_to_u128;
use cuprate_types::{
blockchain::{BlockchainReadRequest, BlockchainResponse},
Chain, ChainId, ExtendedBlockHeader, OutputHistogramInput, OutputOnChain,
Chain, ChainId, ExtendedBlockHeader, MissingTxsInBlock, OutputHistogramInput, OutputOnChain,
};
use crate::{

View file

@ -11,9 +11,11 @@ use std::{
use monero_serai::block::Block;
use crate::{
types::{MissingTxsInBlock, Chain, ExtendedBlockHeader, OutputOnChain, VerifiedBlockInformation},
BlockCompleteEntry,
AltBlockInformation, ChainId, CoinbaseTxSum, OutputHistogramEntry, OutputHistogramInput,
types::{
Chain, ExtendedBlockHeader, MissingTxsInBlock, OutputOnChain, VerifiedBlockInformation,
},
AltBlockInformation, BlockCompleteEntry, ChainId, CoinbaseTxSum, OutputHistogramEntry,
OutputHistogramInput,
};
//---------------------------------------------------------------------------------------------------- ReadRequest
@ -130,7 +132,9 @@ pub enum BlockchainReadRequest {
AltBlocksInChain(ChainId),
/// Get a [`Block`] by its height.
Block { height: usize },
Block {
height: usize,
},
/// Get a [`Block`] by its hash.
BlockByHash([u8; 32]),
@ -150,7 +154,10 @@ pub enum BlockchainReadRequest {
/// `N` last blocks starting at particular height.
///
/// TODO: document fields after impl.
CoinbaseTxSum { height: usize, count: u64 },
CoinbaseTxSum {
height: usize,
count: u64,
},
}
//---------------------------------------------------------------------------------------------------- WriteRequest

View file

@ -21,8 +21,9 @@ pub use transaction_verification_data::{
};
pub use types::{
AltBlockInformation, Chain, ChainId, ChainInfo, CoinbaseTxSum, ExtendedBlockHeader,
FeeEstimate, HardForkInfo, MinerData, MinerDataTxBacklogEntry, OutputHistogramEntry,
OutputHistogramInput, OutputOnChain, VerifiedBlockInformation, VerifiedTransactionInformation,
FeeEstimate, HardForkInfo, MinerData, MinerDataTxBacklogEntry, MissingTxsInBlock,
OutputHistogramEntry, OutputHistogramInput, OutputOnChain, VerifiedBlockInformation,
VerifiedTransactionInformation,
};
//---------------------------------------------------------------------------------------------------- Feature-gated