Skip to content

Commit

Permalink
tag trunk and branch after traversing
Browse files Browse the repository at this point in the history
  • Loading branch information
pvdrz committed Sep 16, 2020
1 parent f55cf94 commit 6633eac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 0 additions & 4 deletions bee-protocol/src/worker/milestone_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,6 @@ where
if let Some(_) = Protocol::get().requested_milestones.remove(&milestone.index) {
tangle().update_metadata(&milestone.hash, |meta| meta.flags.set_requested(true));

let tx = tangle().get(&milestone.hash).unwrap();
tangle().update_metadata(tx.trunk(), |meta| meta.flags.set_requested(true));
tangle().update_metadata(tx.branch(), |meta| meta.flags.set_requested(true));

Protocol::trigger_milestone_solidification(milestone.index);
}
}
Expand Down
5 changes: 5 additions & 0 deletions bee-protocol/src/worker/solidifier/milestone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use crate::{milestone::MilestoneIndex, protocol::Protocol, tangle::tangle};

use bee_common::{shutdown_stream::ShutdownStream, worker::Error as WorkerError};
use bee_transaction::Vertex;
use bee_tangle::traversal;

use futures::{
Expand Down Expand Up @@ -57,6 +58,10 @@ impl MilestoneSolidifierWorker {
|missing_hash| Protocol::request_transaction(*missing_hash, target_index),
);

let tx = tangle().get(&target_hash).unwrap();
tangle().update_metadata(tx.trunk(), |meta| meta.flags.set_requested(true));
tangle().update_metadata(tx.branch(), |meta| meta.flags.set_requested(true));

self.next_ms_index = target_index + MilestoneIndex(1);
}
}
Expand Down

0 comments on commit 6633eac

Please sign in to comment.