diff --git a/iroh-bytes/src/store/file.rs b/iroh-bytes/src/store/file.rs index 6282c3f7b9..04b8513c39 100644 --- a/iroh-bytes/src/store/file.rs +++ b/iroh-bytes/src/store/file.rs @@ -1612,10 +1612,16 @@ impl ActorState { })? .to_owned(); // we can not reference external files, so we just copy them. But this does not have to happen in the actor. - self.rt.spawn_blocking(move || { - tx.send(export_file_copy(temp_tag, path, size, target, progress)) - .ok(); - }); + if path == target { + // export to the same path, nothing to do + tx.send(Ok(())).ok(); + } else { + // copy in an external thread + self.rt.spawn_blocking(move || { + tx.send(export_file_copy(temp_tag, path, size, target, progress)) + .ok(); + }); + } } } }