Skip to content

Commit

Permalink
Added trigger payments to API
Browse files Browse the repository at this point in the history
  • Loading branch information
scx1332 committed Jul 31, 2024
1 parent da2947b commit ab2a20b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/erc20_payment_lib/src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,6 +1072,18 @@ impl PaymentRuntime {
}
}

pub fn trigger_payments(&self, deadline: DateTime<Utc>, account: &SignerAccount) {
let mut ext_gath_time_guard = account.external_gather_time.lock().unwrap();
let new_time = ext_gath_time_guard
.map(|t| t.min(deadline))
.unwrap_or(deadline);

if Some(new_time) != *ext_gath_time_guard {
*ext_gath_time_guard = Some(new_time);
self.wake.notify_one();
}
}

pub async fn distribute_gas(
&self,
chain_name: &str,
Expand Down

0 comments on commit ab2a20b

Please sign in to comment.