cuprate_txpool/ops.rs
1//! Abstracted Monero tx-pool database operations.
2//!
3
4mod key_images;
5mod tx_read;
6mod tx_write;
7
8use crate::error::TxPoolError;
9pub use tx_read::{get_transaction_verification_data, in_stem_pool};
10pub use tx_write::{add_transaction, remove_transaction};
11
12/// An error that can occur on some tx-write ops.
13#[derive(thiserror::Error, Debug)]
14pub enum TxPoolWriteError {
15 /// The transaction could not be added as it double spends another tx in the pool.
16 ///
17 /// The inner value is the hash of the transaction that was double spent.
18 #[error("Transaction doubles spent transaction already in the pool ({}).", hex::encode(.0))]
19 DoubleSpend(crate::types::TransactionHash),
20 #[error("{0}")]
21 TxPool(#[from] TxPoolError),
22}