File tree Expand file tree Collapse file tree 2 files changed +18
-4
lines changed
Expand file tree Collapse file tree 2 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -571,25 +571,39 @@ func (t *txPool) checkTxBatch(ctx context.Context) error {
571571 )
572572
573573 // Queue checked transactions for scheduling.
574+ stateSeqNums := make (map [string ]uint64 )
574575 for i , pct := range goodPcts {
575- if err = t .mainQueue .Add (pct .TxQueueMeta , results [batchIndices [i ]].Meta ); err != nil {
576+ idx := batchIndices [i ]
577+ res := results [idx ]
578+
579+ // XXXX: Temporary workaround for an Oasis SDK bug that incorrectly
580+ // increments the sender's state sequence number during transaction
581+ // check.
582+ sender := string (res .Meta .Sender )
583+ if seq , ok := stateSeqNums [sender ]; ok {
584+ res .Meta .SenderStateSeq = seq
585+ } else {
586+ stateSeqNums [sender ] = res .Meta .SenderStateSeq
587+ }
588+
589+ if err = t .mainQueue .Add (pct .TxQueueMeta , res .Meta ); err != nil {
576590 t .logger .Error ("unable to queue transaction for scheduling" ,
577591 "err" , err ,
578592 "hash" , pct .Hash (),
579593 )
580594
581595 // Change the result into an error and notify submitter.
582- results [ batchIndices [ i ]] .Error = protocol.Error {
596+ res .Error = protocol.Error {
583597 Module : "txpool" ,
584598 Code : 1 ,
585599 Message : err .Error (),
586600 }
587- notifySubmitter (batchIndices [ i ] )
601+ notifySubmitter (idx )
588602 continue
589603 }
590604
591605 // Notify submitter of success.
592- notifySubmitter (batchIndices [ i ] )
606+ notifySubmitter (idx )
593607
594608 if ! pct .flags .isRecheck () {
595609 // Mark new transactions as never having been published. The republish worker will
You can’t perform that action at this time.
0 commit comments