-
Notifications
You must be signed in to change notification settings - Fork 363
fix: cache block of pending transaction #3718
Conversation
CLA Assistant Lite All Contributors have signed the CLA. |
ESLint Summary View Full Report
Report generated by eslint-plus-action |
Pull Request Test Coverage Report for Build 2028277882
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done 👍
Looks good to me Created a tx with low gas and cancelled it in the MM extension with higher gas. As soon as the cancelation was succesful in the blockexplorer the tx changed from "peding" to "needs execution" |
What it solves
Slow clearance of pending transactions
How this PR fixes it
Instead of the pending watcher waiting for the current block + 50 to clear an (unsuccessful) pending transaction upon wallet connection, the block number upon executing a transaction is cached. The watcher now waits for cached block number (if it exists) + 50 instead. It falls back to the current block number if the original block number retrieval failed.
How to test it
block
stored under the transactionid
in the store.