Skip to content

Commit

Permalink
fix: nonce not update in retrying task
Browse files Browse the repository at this point in the history
  • Loading branch information
dejavukong committed Jul 7, 2022
1 parent 0ab2463 commit cb631d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/src/entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ pub async fn run(
&e,
config.name.clone(),
);
monitor_sender5.send(monitor_metrics).await;
let _res = monitor_sender5.send(monitor_metrics).await;
}

// todo: this bracket code no need
Expand Down
10 changes: 5 additions & 5 deletions moonbeam/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -280,17 +280,17 @@ pub async fn resubmit_txs(
);

let last_sent_tx = queue_guard.back().cloned().unwrap_or_default();
// pick a nonce, construct raw tx and send it onchain
// todo: throw?
let nonce = latest_nonce(&last_sent_tx, config, keeper_address).await;
// tx_hash here must be a Ok value
let tx_hash = loop {
let (tx_hash, nonce) = loop {
// pick a nonce, construct raw tx and send it onchain
// todo: throw?
let nonce = latest_nonce(&last_sent_tx, config, keeper_address).await;
let hash =
construct_tx_and_send(contract, keeper_pri_optional, nonce, params.clone())
.await;

if hash.is_ok() {
break hash
break (hash, nonce)
}

// todo: make this configurable
Expand Down

0 comments on commit cb631d7

Please sign in to comment.