mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-08 20:09:44 +00:00
fix merge
This commit is contained in:
parent
bb7126bd96
commit
dc482558db
4 changed files with 18 additions and 18 deletions
|
@ -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>>()?;
|
||||
|
||||
|
|
|
@ -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::{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue