From 2cc0cf5e920abc74fd397199a22db0f324f8fb2e Mon Sep 17 00:00:00 2001 From: igor-aptos <110557261+igor-aptos@users.noreply.github.com> Date: Mon, 26 Sep 2022 21:52:42 -0700 Subject: [PATCH] [txn-emitter] Fix underflow when first request fails (#4567) This debugging log was added to show txns around the failure, but when it is the first request, there is no previous transaction. --- crates/transaction-emitter-lib/src/emitter/submission_worker.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/transaction-emitter-lib/src/emitter/submission_worker.rs b/crates/transaction-emitter-lib/src/emitter/submission_worker.rs index ee66a1464f6ed..b2ed97c8c5e5c 100644 --- a/crates/transaction-emitter-lib/src/emitter/submission_worker.rs +++ b/crates/transaction-emitter-lib/src/emitter/submission_worker.rs @@ -332,7 +332,7 @@ pub async fn submit_transactions( client .get_account_transactions_bcs( sender, - Some(account.into_inner().sequence_number() - 1), + Some(account.into_inner().sequence_number().saturating_sub(1)), Some(5), ) .await