Skip to content

Commit 5b82747

Browse files
committed
change order and update test
Signed-off-by: Chengxuan Xing <[email protected]>
1 parent 1791f53 commit 5b82747

File tree

2 files changed

+231
-239
lines changed

2 files changed

+231
-239
lines changed

internal/ethereum/confirmation_reconciler.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,6 @@ func (bl *blockListener) reconcileConfirmationsForTransaction(ctx context.Contex
5959
// compareAndUpdateConfirmationQueue orchestrates the confirmation reconciliation process.
6060
// It builds new confirmations from the in-memory partial chain and fills gaps in the confirmation queue.
6161
func (bl *blockListener) compareAndUpdateConfirmationQueue(ctx context.Context, reconcileResult *ffcapi.ConfirmationUpdateResult, txBlockInfo *ffcapi.MinimalBlockInfo, targetConfirmationCount uint64) (*ffcapi.ConfirmationUpdateResult, error) {
62-
var err error
63-
// Build new confirmations from the in-memory partial chain and get existing confirmations
64-
newConfirmationsWithoutTxBlock, lastValidatedBlock, err := bl.buildConfirmationQueueUsingInMemoryPartialChain(ctx, txBlockInfo, targetConfirmationCount)
65-
if err != nil {
66-
return nil, err
67-
}
6862

6963
// Initialize confirmation map and get existing confirmations
7064
// the init must happen after the in-memory partial chain check to avoid
@@ -92,6 +86,13 @@ func (bl *blockListener) compareAndUpdateConfirmationQueue(ctx context.Context,
9286
}
9387
}
9488

89+
var err error
90+
// Build new confirmations from the in-memory partial chain and get existing confirmations
91+
newConfirmationsWithoutTxBlock, lastValidatedBlock, err := bl.buildConfirmationQueueUsingInMemoryPartialChain(ctx, txBlockInfo, targetConfirmationCount)
92+
if err != nil {
93+
return nil, err
94+
}
95+
9596
// Special case: if targetConfirmationCount is 0, transaction is immediately confirmed
9697
if targetConfirmationCount == 0 {
9798
reconcileResult.Confirmations = []*ffcapi.MinimalBlockInfo{txBlockInfo}

0 commit comments

Comments
 (0)