Skip to content

Commit

Permalink
use ledger date for rejected fragments
Browse files Browse the repository at this point in the history
  • Loading branch information
zeegomo committed Jun 18, 2021
1 parent b9edb32 commit 6a4b89b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion jormungandr/src/fragment/logs.rs
Expand Up @@ -111,7 +111,7 @@ impl Logs {
let mut to_remove = Vec::new();
for log in self.logs() {
match log.status() {
FragmentStatus::InABlock { date, .. } | FragmentStatus::Rejected { date, .. } => {
FragmentStatus::InABlock { .. } | FragmentStatus::Rejected { .. } => {
if date > &target_date {
to_remove.push(*log.fragment_id());
} else {
Expand Down
3 changes: 2 additions & 1 deletion jormungandr/src/fragment/selection.rs
Expand Up @@ -5,7 +5,7 @@ use crate::{
fragment::FragmentId,
};
use chain_core::property::Fragment as _;
use jormungandr_lib::interfaces::FragmentStatus;
use jormungandr_lib::interfaces::{BlockDate, FragmentStatus};

use async_trait::async_trait;
use futures::prelude::*;
Expand Down Expand Up @@ -66,6 +66,7 @@ impl FragmentSelectionAlgorithm for OldestFirst {
) -> (Contents, ApplyBlockLedger) {
use futures::future::{select, Either};

let date: BlockDate = ledger.block_date().into();
let mut current_total_size = 0;
let mut contents_builder = ContentsBuilder::new();
let mut return_to_pool = Vec::new();
Expand Down

0 comments on commit 6a4b89b

Please sign in to comment.