tor-dirmgr: Warn on a bug case.

This warning occurs if we ask for microdescriptors from our local
cache, and our cache gives us something we didn't ask for.  It
shouldn't be possible, so let's warn when it occurs.

This patch resolves an XXXX.
This commit is contained in:
Nick Mathewson 2021-12-16 08:51:34 -05:00
parent a0870f8f79
commit b5672cb2c7
1 changed files with 1 additions and 2 deletions

View File

@ -611,8 +611,7 @@ impl<DM: WriteNetDir> DirState for GetMicrodescsState<DM> {
for (id, text) in docs {
if let DocId::Microdesc(digest) = id {
if !self.missing.remove(&digest) {
// XXXX BUG:
// we didn't want this.
warn!("Bug: loaded a microdesc that we didn't want from the cache.");
continue;
}
if let Ok(md) = Microdesc::parse(text.as_str()?) {