@@ -578,7 +578,7 @@ func (pool *OrderPool) add(tx *types.OrderTransaction, local bool) (bool, error)
578578 // If the transaction fails basic validation, discard it
579579 if err := pool .validateTx (tx , local ); err != nil {
580580 log .Debug ("Discarding invalid order transaction" , "hash" , hash , "userAddress" , tx .UserAddress ().Hex (), "status" , tx .Status , "err" , err )
581- invalidTxCounter . Inc (1 )
581+ invalidTxMeter . Mark (1 )
582582 return false , err
583583 }
584584 from , _ := types .OrderSender (pool .signer , tx ) // already validated
@@ -592,12 +592,12 @@ func (pool *OrderPool) add(tx *types.OrderTransaction, local bool) (bool, error)
592592 if list := pool .pending [from ]; list != nil && list .Overlaps (tx ) {
593593 inserted , old := list .Add (tx )
594594 if ! inserted {
595- pendingDiscardCounter . Inc (1 )
595+ pendingDiscardMeter . Mark (1 )
596596 return false , ErrPendingNonceTooLow
597597 }
598598 if old != nil {
599599 delete (pool .all , old .Hash ())
600- pendingReplaceCounter . Inc (1 )
600+ pendingReplaceMeter . Mark (1 )
601601 }
602602 pool .all [tx .Hash ()] = tx
603603 pool .journalTx (from , tx )
@@ -635,13 +635,13 @@ func (pool *OrderPool) enqueueTx(hash common.Hash, tx *types.OrderTransaction) (
635635 inserted , old := pool .queue [from ].Add (tx )
636636 if ! inserted {
637637 // An older transaction was better, discard this
638- queuedDiscardCounter . Inc (1 )
638+ queuedDiscardMeter . Mark (1 )
639639 return false , ErrPendingNonceTooLow
640640 }
641641 // Discard any previous transaction and mark this
642642 if old != nil {
643643 delete (pool .all , old .Hash ())
644- queuedReplaceCounter . Inc (1 )
644+ queuedReplaceMeter . Mark (1 )
645645 }
646646 pool .all [hash ] = tx
647647 return old != nil , nil
@@ -674,13 +674,13 @@ func (pool *OrderPool) promoteTx(addr common.Address, hash common.Hash, tx *type
674674 if ! inserted {
675675 // An older transaction was better, discard this
676676 delete (pool .all , hash )
677- pendingDiscardCounter . Inc (1 )
677+ pendingDiscardMeter . Mark (1 )
678678 return
679679 }
680680 // Otherwise discard any previous transaction and mark this
681681 if old != nil {
682682 delete (pool .all , old .Hash ())
683- pendingReplaceCounter . Inc (1 )
683+ pendingReplaceMeter . Mark (1 )
684684 }
685685 // Failsafe to work around direct pending inserts (tests)
686686 if pool .all [hash ] == nil {
@@ -895,7 +895,7 @@ func (pool *OrderPool) promoteExecutables(accounts []common.Address) {
895895 hash := tx .Hash ()
896896 delete (pool .all , hash )
897897
898- queuedRateLimitCounter . Inc (1 )
898+ queuedRateLimitMeter . Mark (1 )
899899 log .Debug ("Removed cap-exceeding queued transaction" , "addr" , tx .UserAddress ().Hex (), "nonce" , tx .Nonce (), "ohash" , tx .OrderHash ().Hex (), "status" , tx .Status (), "orderid" , tx .OrderID ())
900900 }
901901 }
@@ -972,7 +972,7 @@ func (pool *OrderPool) promoteExecutables(accounts []common.Address) {
972972 }
973973 }
974974 }
975- pendingRateLimitCounter . Inc (int64 (pendingBeforeCap - pending ))
975+ pendingRateLimitMeter . Mark (int64 (pendingBeforeCap - pending ))
976976 }
977977 // If we've queued more transactions than the hard limit, drop oldest ones
978978 queued := uint64 (0 )
@@ -1002,15 +1002,15 @@ func (pool *OrderPool) promoteExecutables(accounts []common.Address) {
10021002 pool .removeTx (tx .Hash ())
10031003 }
10041004 drop -= size
1005- queuedRateLimitCounter . Inc (int64 (size ))
1005+ queuedRateLimitMeter . Mark (int64 (size ))
10061006 continue
10071007 }
10081008 // Otherwise drop only last few transactions
10091009 txs := list .Flatten ()
10101010 for i := len (txs ) - 1 ; i >= 0 && drop > 0 ; i -- {
10111011 pool .removeTx (txs [i ].Hash ())
10121012 drop --
1013- queuedRateLimitCounter . Inc (1 )
1013+ queuedRateLimitMeter . Mark (1 )
10141014 }
10151015 }
10161016 }
0 commit comments