Skip to content

Commit

Permalink
#314: Add successful transactions to the transaction cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mvandeberg committed Dec 13, 2024
1 parent 6f8a4fe commit a1e058c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/p2p/applicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ func (a *Applicator) handleTransactionStatus(ctx context.Context, status *transa
delete(a.pendingTransactions, string(status.transaction.Id))

if status.err == nil {
a.transactionCache.AddTransactions(status.transaction)
a.checkTransactionChildren(ctx, status.transaction)
} else if errors.Is(status.err, p2perrors.ErrInvalidNonce) {
return
Expand Down Expand Up @@ -615,6 +616,7 @@ func (a *Applicator) handleBlockBroadcast(ctx context.Context, blockAccept *broa
}

func (a *Applicator) handleTransactionBroadcast(ctx context.Context, transactionAccept *broadcast.TransactionAccepted) {
a.transactionCache.AddTransactions(transactionAccept.Transaction)
a.checkTransactionChildren(ctx, transactionAccept.Transaction)
}

Expand Down

0 comments on commit a1e058c

Please sign in to comment.