Skip to content

Commit 1ea3afa

Browse files
committed
fix: use requesting value in global
Signed-off-by: Gustavo Inacio <[email protected]>
1 parent 09993b7 commit 1ea3afa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

tap-agent/src/tracker/generic_tracker.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ impl GenericTracker<GlobalFeeTracker, SenderFeeStats, DurationInfo, Unaggregated
164164
.id_to_fee
165165
.entry(allocation_id)
166166
.or_insert(SenderFeeStats::default_from_extra(&self.extra_data));
167-
entry.requesting = true;
168-
self.global.requesting += entry.total_fee;
167+
entry.requesting = entry.total_fee;
168+
self.global.requesting += entry.requesting;
169169
}
170170

171171
/// Should be called before `update`
@@ -174,8 +174,8 @@ impl GenericTracker<GlobalFeeTracker, SenderFeeStats, DurationInfo, Unaggregated
174174
.id_to_fee
175175
.entry(allocation_id)
176176
.or_insert(SenderFeeStats::default_from_extra(&self.extra_data));
177-
entry.requesting = false;
178-
self.global.requesting -= entry.total_fee;
177+
self.global.requesting -= entry.requesting;
178+
entry.requesting = 0;
179179
}
180180

181181
pub fn ok_rav_request(&mut self, allocation_id: Address) {

tap-agent/src/tracker/sender_fee_stats.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub struct SenderFeeStats {
1818
// heaviest allocation, because they are already marked for finalization,
1919
// and thus requesting RAVs on their own in their `post_stop` routine.
2020
pub(super) blocked: bool,
21-
pub(super) requesting: bool,
21+
pub(super) requesting: u128,
2222

2323
// Buffer info
2424
pub(super) buffer_info: BufferInfo,
@@ -103,7 +103,7 @@ impl AllocationStats<UnaggregatedReceipts> for SenderFeeStats {
103103
}
104104

105105
fn is_allowed_to_trigger_rav_request(&self) -> bool {
106-
!self.backoff_info.in_backoff() && !self.blocked && !self.requesting
106+
!self.backoff_info.in_backoff() && !self.blocked && self.requesting == 0
107107
}
108108

109109
fn get_stats(&self) -> UnaggregatedReceipts {

0 commit comments

Comments
 (0)