Struct saito_rust::mempool::Mempool [−][src]
pub struct Mempool {
pub transactions: Vec<Transaction>,
// some fields omitted
}
Expand description
The Mempool
holds unprocessed blocks and transactions and is in control of
discerning when the node is allowed to create a block. It bundles the block and
sends it to the Blockchain
to be added to the longest-chain. New Block
s
received over the network are queued in the Mempool
before being added to
the Blockchain
Fields
transactions: Vec<Transaction>
Implementations
pub async fn add_transaction_if_validates(
&mut self,
transaction: Transaction,
blockchain_lock: Arc<RwLock<Blockchain>>
)
pub async fn bundle_block(
&mut self,
blockchain_lock: Arc<RwLock<Blockchain>>,
current_timestamp: u64
) -> Block
pub async fn can_bundle_block(
&self,
blockchain_lock: Arc<RwLock<Blockchain>>,
current_timestamp: u64
) -> bool
Calculates the work available in mempool to produce a block
pub async fn send_blocks_to_blockchain(
mempool_lock: Arc<RwLock<Mempool>>,
blockchain_lock: Arc<RwLock<Blockchain>>
)
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Mempool
impl !UnwindSafe for Mempool
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more