node: Allow seed not to be connected on fetch

See code comment for explanation.
This commit is contained in:
Alexis Sellier 2023-05-22 15:30:27 +02:00
parent 95e3b9673d
commit 5a46ded318
No known key found for this signature in database
1 changed files with 6 additions and 2 deletions

View File

@ -555,8 +555,12 @@ where
error!(target: "service", "Session {from} does not exist; cannot initiate fetch");
return;
};
debug_assert!(session.is_connected());
if !session.is_connected() {
// This can happen if a session disconnects in the time between asking for seeds to
// fetch from, and initiating the fetch from one of those seeds.
error!(target: "service", "Session {from} is not connected; cannot initiate fetch");
return;
}
let seed = session.id;
match session.fetch(rid) {