Fix up bridge_unreachable
This commit is contained in:
parent
0ede04164b
commit
610a579731
|
@ -368,7 +368,7 @@ impl BridgeAuth {
|
|||
if let Some(v) = positions {
|
||||
for (bucketnum, offset) in v.iter() {
|
||||
println!("Bucket num: {:?} and offset: {:?}", bucketnum, offset);
|
||||
let bridgelines = match self.bridge_table.buckets.get(bucketnum) {
|
||||
let mut bridgelines = match self.bridge_table.buckets.get(bucketnum) {
|
||||
Some(bridgelines) => *bridgelines,
|
||||
None => return res,
|
||||
};
|
||||
|
@ -526,14 +526,15 @@ impl BridgeAuth {
|
|||
if let Some(v) = positions {
|
||||
for (bucketnum, offset) in v.iter() {
|
||||
// Count how many bridges in this bucket are reachable
|
||||
let numreachable = self.bridge_table.buckets[*bucketnum as usize]
|
||||
let mut bucket = self.bridge_table.buckets.get(bucketnum).unwrap();
|
||||
let numreachable = bucket
|
||||
.iter()
|
||||
.filter(|br| self.bridge_table.reachable.get(br).is_some())
|
||||
.count();
|
||||
|
||||
// Remove the bridge from the bucket
|
||||
assert!(self.bridge_table.buckets[*bucketnum as usize][*offset] == *bridge);
|
||||
self.bridge_table.buckets[*bucketnum as usize][*offset] = BridgeLine::default();
|
||||
assert!(bucket[*offset] == *bridge);
|
||||
bucket[*offset] = BridgeLine::default();
|
||||
|
||||
// Is this bucket an open-invitation bucket?
|
||||
if bdb.openinv_buckets.contains(bucketnum) {
|
||||
|
|
|
@ -159,8 +159,8 @@ pub fn encrypt_cred_ids(
|
|||
migrationkey_priv: &IssuerPrivKey,
|
||||
) -> Option<([u8; 16], [u8; ENC_MIGRATION_BYTES])> {
|
||||
// Look up the bucket keys and form the attributes (Scalars)
|
||||
let fromkey = bridgetable.keys.get(from_id as usize)?;
|
||||
let tokey = bridgetable.keys.get(to_id as usize)?;
|
||||
let fromkey = bridgetable.keys.get(&from_id)?;
|
||||
let tokey = bridgetable.keys.get(&to_id)?;
|
||||
Some(encrypt_cred(
|
||||
id,
|
||||
&bridge_table::to_scalar(from_id, fromkey),
|
||||
|
|
Loading…
Reference in New Issue