mirror of
https://github.com/Cuprate/cuprate.git
synced 2025-01-10 21:05:01 +00:00
Boog900
8655a3f5e5
* init * reduce the jobs handled by the dandelion pool * fix docs * resolve todo * review changes * Update p2p/dandelion-tower/src/pool/incoming_tx.rs Co-authored-by: hinto-janai <hinto.janai@protonmail.com> * Update p2p/dandelion-tower/src/pool/incoming_tx.rs Co-authored-by: hinto-janai <hinto.janai@protonmail.com> * `PId` -> `PeerId` --------- Co-authored-by: hinto-janai <hinto.janai@protonmail.com>
31 lines
1 KiB
Rust
31 lines
1 KiB
Rust
/// A request to diffuse a transaction to all connected peers.
|
|
///
|
|
/// This crate does not handle diffusion it is left to implementers.
|
|
pub struct DiffuseRequest<Tx>(pub Tx);
|
|
|
|
/// A request sent to a single peer to stem this transaction.
|
|
pub struct StemRequest<Tx>(pub Tx);
|
|
|
|
#[cfg(feature = "txpool")]
|
|
/// A request sent to the backing transaction pool storage.
|
|
pub enum TxStoreRequest<TxId> {
|
|
/// A request to retrieve a `Tx` with the given Id from the pool, should not remove that tx from the pool.
|
|
///
|
|
/// Must return [`TxStoreResponse::Transaction`]
|
|
Get(TxId),
|
|
/// Promote a transaction from the stem pool to the public pool.
|
|
///
|
|
/// If the tx is already in the fluff pool do nothing.
|
|
///
|
|
/// This should not error if the tx isn't in the pool at all.
|
|
Promote(TxId),
|
|
}
|
|
|
|
#[cfg(feature = "txpool")]
|
|
/// A response sent back from the backing transaction pool.
|
|
pub enum TxStoreResponse<Tx> {
|
|
/// A generic ok response.
|
|
Ok,
|
|
/// A response containing a requested transaction.
|
|
Transaction(Option<(Tx, crate::State)>),
|
|
}
|