Crate cached_pos_ledger_db
source ·Structs§
- The struct that stores all speculation result of its counterpart in consensus.
- SpeculationCache implements the block tree structure. The tree is represented by a root block id, all the children of root and a global block map. Each block is an
Arc<Mutex<SpeculationBlock>>
with ref_count = 1. For the chidren of the root, the sole owner isheads
. For the rest, the sole owner is their parent block. So when a block is dropped, all its descendants will be dropped recursively. In the meanwhile, wheir entries in the block map will be removed by each block’s drop().