node: Skip trusted peers that aren't local
This commit is contained in:
parent
b2f9ca61d5
commit
0d98b84861
|
|
@ -10,7 +10,7 @@ use radicle::crypto::{PublicKey, Unverified, Verified};
|
||||||
use radicle::git::url;
|
use radicle::git::url;
|
||||||
use radicle::prelude::{Doc, Id, NodeId};
|
use radicle::prelude::{Doc, Id, NodeId};
|
||||||
use radicle::storage::git::Repository;
|
use radicle::storage::git::Repository;
|
||||||
use radicle::storage::refs::{SignedRefs, IDENTITY_BRANCH};
|
use radicle::storage::refs::IDENTITY_BRANCH;
|
||||||
use radicle::storage::{Namespaces, RefUpdate, Remote, RemoteId};
|
use radicle::storage::{Namespaces, RefUpdate, Remote, RemoteId};
|
||||||
use radicle::storage::{ReadRepository, ReadStorage, WriteRepository, WriteStorage};
|
use radicle::storage::{ReadRepository, ReadStorage, WriteRepository, WriteStorage};
|
||||||
use radicle::{git, Storage};
|
use radicle::{git, Storage};
|
||||||
|
|
@ -354,19 +354,11 @@ impl<'a> StagingPhaseFinal<'a> {
|
||||||
fn remotes(&self) -> impl Iterator<Item = Remote> + '_ {
|
fn remotes(&self) -> impl Iterator<Item = Remote> + '_ {
|
||||||
self.trusted
|
self.trusted
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|remote| match SignedRefs::load(remote, self.repo.deref()) {
|
.filter_map(|remote| self.repo.remote(remote).ok())
|
||||||
Ok(refs) => Some(Remote::new(*remote, refs)),
|
|
||||||
Err(err) => {
|
|
||||||
log::warn!(target: "worker", "{remote} failed rad/sigrefs verification: {err}");
|
|
||||||
None
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn verify(&self) -> BTreeMap<RemoteId, VerifiedRemote> {
|
fn verify(&self) -> BTreeMap<RemoteId, VerifiedRemote> {
|
||||||
self.trusted
|
self.remotes()
|
||||||
.iter()
|
|
||||||
.filter_map(|remote| self.repo.remote(remote).ok())
|
|
||||||
.map(|remote| {
|
.map(|remote| {
|
||||||
let remote_id = remote.id;
|
let remote_id = remote.id;
|
||||||
let verification = match self.repo.identity_doc_of(&remote_id) {
|
let verification = match self.repo.identity_doc_of(&remote_id) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue