pub struct Mempool { /* private fields */ }Expand description
未承認のトランザクションの置き場
Implementations§
Source§impl Mempool
impl Mempool
pub fn new(parameters: &'static NetworkParameters, config: Config) -> Self
pub fn is_empty(&self) -> bool
pub fn contains(&self, hash: &Hash256) -> bool
Sourcepub fn short_hashes(&self) -> Vec<u32>
pub fn short_hashes(&self) -> Vec<u32>
持っているものの短いハッシュ(short_hash)。ピアに Pull_Transactions で頼むとき、持っているものを伝える
Sourcepub fn min_fee_multiplier(&self) -> u32
pub fn min_fee_multiplier(&self) -> u32
受け付ける手数料の倍率の下限。ピアに頼むときも、これより低いものは要らないと伝える
Sourcepub fn add(
&mut self,
bytes: Vec<u8>,
now: u64,
height: u64,
) -> Result<Hash256, Rejected>
pub fn add( &mut self, bytes: Vec<u8>, now: u64, height: u64, ) -> Result<Hash256, Rejected>
署名したトランザクション bytes を、今(Nemesis からのミリ秒 now)、高さ height のブロックに入れる
つもりで受け付ける。いっぱいなら、手数料の倍率がこれより低いものを追い出して空ける。受け付けたらハッシュを返す
Sourcepub fn add_completed(
&mut self,
bytes: Vec<u8>,
now: u64,
height: u64,
) -> Result<Hash256, Rejected>
pub fn add_completed( &mut self, bytes: Vec<u8>, now: u64, height: u64, ) -> Result<Hash256, Rejected>
連署を待つものの置き場(partial)で、ハッシュロックと連署が揃ったと確かめたアグリゲートボンデッドを受け付ける。
期限が maxTransactionLifetime より先でも(ボンデッドは maxBondedTransactionLifetime まで)受け付ける
Sourcepub fn tip_changed(
&mut self,
included: &[Hash256],
restored: Vec<Vec<u8>>,
now: u64,
height: u64,
)
pub fn tip_changed( &mut self, included: &[Hash256], restored: Vec<Vec<u8>>, now: u64, height: u64, )
先端が変わった。新しい先端の枝に入ったトランザクション included を外し、巻き戻した枝から外れたもの
restored を受け付け直し、期限の過ぎたものを掃除する。now と height は Mempool::add と同じ
Sourcepub fn reject(&mut self, hash: &Hash256) -> bool
pub fn reject(&mut self, hash: &Hash256) -> bool
ブロックを作ってみて弾かれたので外し、期限まで弾いたものとして覚える。持っていたら真。
catapult は状態に依る確かめを未承認のうちにするので、そこで弾いたものを failed と答える。heika は作るときに
確かめるので、ここで覚えたものを同じく答える
Sourcepub fn candidates(&self, timestamp: u64) -> Vec<Candidate>
pub fn candidates(&self, timestamp: u64) -> Vec<Candidate>
時刻 timestamp のブロックに入れられる候補。選ぶのは heika_chain::produce::choose
Sourcepub fn transactions(&self) -> impl Iterator<Item = (&Hash256, &[u8])>
pub fn transactions(&self) -> impl Iterator<Item = (&Hash256, &[u8])>
持っているものを、受け付けた順に(REST の /transactions/unconfirmed)
Auto Trait Implementations§
impl Freeze for Mempool
impl RefUnwindSafe for Mempool
impl Send for Mempool
impl Sync for Mempool
impl Unpin for Mempool
impl UnsafeUnpin for Mempool
impl UnwindSafe for Mempool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more