-
Notifications
You must be signed in to change notification settings - Fork 186
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent panic in TransactionByHash for non-existent transactions
When searching for a transaction in the pending block, the code would continue to AdaptTransaction even if no matching transaction was found. This could lead to a panic when trying to adapt a nil transaction. Added a nil check and an early break from the loop to ensure we properly handle non-existent transactions with ErrTxnHashNotFound. Changes: - Add break statement to exit loop once matching transaction is found - Add explicit nil check for txn before attempting to adapt it - Return ErrTxnHashNotFound if no matching transaction is found
- Loading branch information
1 parent
d99e28b
commit 3c1e532
Showing
2 changed files
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters