[−][src]Struct grin_pool::transaction_pool::TransactionPool
Transaction pool implementation.
Fields
config: PoolConfig
Pool Config
txpool: Pool
Our transaction pool.
stempool: Pool
Our Dandelion "stempool".
reorg_cache: Arc<RwLock<VecDeque<PoolEntry>>>
Cache of previous txs in case of a re-org.
blockchain: Arc<dyn BlockChain>
The blockchain
verifier_cache: Arc<RwLock<dyn VerifierCache>>
adapter: Arc<dyn PoolAdapter>
The pool adapter
Methods
impl TransactionPool
[src]
pub fn new(
config: PoolConfig,
chain: Arc<dyn BlockChain>,
verifier_cache: Arc<RwLock<dyn VerifierCache>>,
adapter: Arc<dyn PoolAdapter>
) -> TransactionPool
[src]
config: PoolConfig,
chain: Arc<dyn BlockChain>,
verifier_cache: Arc<RwLock<dyn VerifierCache>>,
adapter: Arc<dyn PoolAdapter>
) -> TransactionPool
Create a new transaction pool
pub fn chain_head(&self) -> Result<BlockHeader, PoolError>
[src]
pub fn add_to_pool(
&mut self,
src: TxSource,
tx: Transaction,
stem: bool,
header: &BlockHeader
) -> Result<(), PoolError>
[src]
&mut self,
src: TxSource,
tx: Transaction,
stem: bool,
header: &BlockHeader
) -> Result<(), PoolError>
Add the given tx to the pool, directing it to either the stempool or txpool based on stem flag provided.
pub fn evict_from_txpool(&mut self)
[src]
pub fn truncate_reorg_cache(&mut self, cutoff: DateTime<Utc>)
[src]
pub fn reconcile_reorg_cache(
&mut self,
header: &BlockHeader
) -> Result<(), PoolError>
[src]
&mut self,
header: &BlockHeader
) -> Result<(), PoolError>
pub fn reconcile_block(&mut self, block: &Block) -> Result<(), PoolError>
[src]
Reconcile the transaction pool (both txpool and stempool) against the provided block.
pub fn retrieve_tx_by_kernel_hash(&self, hash: Hash) -> Option<Transaction>
[src]
Retrieve individual transaction for the given kernel hash.
pub fn retrieve_transactions(
&self,
hash: Hash,
nonce: u64,
kern_ids: &[ShortId]
) -> (Vec<Transaction>, Vec<ShortId>)
[src]
&self,
hash: Hash,
nonce: u64,
kern_ids: &[ShortId]
) -> (Vec<Transaction>, Vec<ShortId>)
Retrieve all transactions matching the provided "compact block" based on the kernel set. Note: we only look in the txpool for this (stempool is under embargo).
pub fn total_size(&self) -> usize
[src]
Get the total size of the pool. Note: we only consider the txpool here as stempool is under embargo.
pub fn prepare_mineable_transactions(
&self
) -> Result<Vec<Transaction>, PoolError>
[src]
&self
) -> Result<Vec<Transaction>, PoolError>
Returns a vector of transactions from the txpool so we can build a block from them.
Auto Trait Implementations
impl Send for TransactionPool
impl Sync for TransactionPool
impl Unpin for TransactionPool
impl !UnwindSafe for TransactionPool
impl !RefUnwindSafe for TransactionPool
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<T> Same<T> for T
type Output = T
Should always be Self