@@ -394,10 +394,16 @@ export class PendingTransactionTracker {
394394 return blocksSinceFirstRetry >= requiredBlocksSinceFirstRetry ;
395395 }
396396
397- #cleanTransactionToForcePoll( transactionId : string ) : void {
398- if ( this . #transactionToForcePoll?. id === transactionId ) {
397+ #cleanTransaction( txMeta : TransactionMeta ) : void {
398+ const { hash, id } = txMeta ;
399+
400+ if ( this . #transactionToForcePoll?. id === id ) {
399401 this . #transactionToForcePoll = undefined ;
400402 }
403+
404+ if ( hash ) {
405+ this . #lastSeenTimestampByHash. delete ( hash ) ;
406+ }
401407 }
402408
403409 async #checkTransaction( txMeta : TransactionMeta ) : Promise < void > {
@@ -492,8 +498,11 @@ export class PendingTransactionTracker {
492498
493499 this . #log( 'Transaction confirmed' , id ) ;
494500
495- if ( this . #transactionToForcePoll) {
496- this . #cleanTransactionToForcePoll( txMeta . id ) ;
501+ const isForcePollTransaction = this . #transactionToForcePoll?. id === id ;
502+
503+ this . #cleanTransaction( txMeta ) ;
504+
505+ if ( isForcePollTransaction ) {
497506 this . hub . emit ( 'transaction-confirmed' , txMeta ) ;
498507 return ;
499508 }
@@ -709,13 +718,13 @@ export class PendingTransactionTracker {
709718
710719 #failTransaction( txMeta : TransactionMeta , error : Error ) : void {
711720 this . #log( 'Transaction failed' , txMeta . id , error ) ;
712- this . #cleanTransactionToForcePoll ( txMeta . id ) ;
721+ this . #cleanTransaction ( txMeta ) ;
713722 this . hub . emit ( 'transaction-failed' , txMeta , error ) ;
714723 }
715724
716725 #dropTransaction( txMeta : TransactionMeta ) : void {
717726 this . #log( 'Transaction dropped' , txMeta . id ) ;
718- this . #cleanTransactionToForcePoll ( txMeta . id ) ;
727+ this . #cleanTransaction ( txMeta ) ;
719728 this . hub . emit ( 'transaction-dropped' , txMeta ) ;
720729 }
721730
0 commit comments