OrphanBlockPool > Orphan > 块

孤儿块,也是块。事后确认,也需要添加。

Orphan

struct Orphan {
    block: Block,
    opts: Options,
    added: Instant,
}

OrphanBlockPool

pub struct OrphanBlockPool {
    // blocks indexed by their hash
    orphans: RwLock<HashMap<Hash, Orphan>>,
    // additional index of height -> hash
    // so we can efficiently identify a child block (ex-orphan) after processing a block
    height_idx: RwLock<HashMap<u64, Vec<Hash>>>,
    // accumulated number of evicted block because of MAX_ORPHAN_SIZE limitation
    evicted: AtomicUsize,
}

操作

添加、移除等。

results matching ""

    No results matching ""