Struct bitcoin_addrman::AddrManInner
source · pub struct AddrManInner {
pub insecure_rand: RefCell<FastRandomContext>,
pub n_id_count: i32,
pub map_info: HashMap<i32, AddrInfo>,
pub map_addr: HashMap<Service, i32, ServiceHash>,
pub random: RefCell<Vec<i32>>,
pub n_tried: i32,
pub vv_tried: AddrManTriedBucketList,
pub n_new: i32,
pub vv_new: AddrManNewBucketList,
pub n_last_good: i64,
}
Fields§
§insecure_rand: RefCell<FastRandomContext>
| Source of random numbers for randomization | in inner loops |
n_id_count: i32
| last used nId |
map_info: HashMap<i32, AddrInfo>
| table with information about all n_ids |
map_addr: HashMap<Service, i32, ServiceHash>
| find an nId based on its network address | and port. |
random: RefCell<Vec<i32>>
| randomly-ordered vector of all n_ids | | This is mutable because it is unobservable | outside the class, so any changes to it | (even in const methods) are also | unobservable.
n_tried: i32
| number of “tried” entries |
vv_tried: AddrManTriedBucketList
| list of “tried” buckets |
n_new: i32
| number of (unique) “new” entries |
vv_new: AddrManNewBucketList
| list of “new” buckets |
n_last_good: i64
| last time Good was called (memory | only). Initially set to 1 so that “never” is | strictly worse.
Implementations§
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
pub fn default_new_bucket_list() -> AddrManNewBucketList
pub fn default_tried_bucket_list() -> AddrManTriedBucketList
pub fn new(deterministic: bool, insecure_rand: FastRandomContext) -> Self
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
source§impl AddrManInner
impl AddrManInner
pub fn set_services(&mut self, addr: &Service, n_services: ServiceFlags)
source§impl AddrManInner
impl AddrManInner
sourcepub fn swap_random(&self, n_rnd_pos1: usize, n_rnd_pos2: usize)
pub fn swap_random(&self, n_rnd_pos1: usize, n_rnd_pos2: usize)
| Swap two elements in vRandom. |
Auto Trait Implementations§
impl !RefUnwindSafe for AddrManInner
impl Send for AddrManInner
impl !Sync for AddrManInner
impl Unpin for AddrManInner
impl UnwindSafe for AddrManInner
Blanket Implementations§
§impl<T, U> CastInto<U> for Twhere
U: CastFrom<T>,
impl<T, U> CastInto<U> for Twhere U: CastFrom<T>,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> StaticUpcast<T> for T
impl<T> StaticUpcast<T> for T
§unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
Convert type of a const pointer. Read more