github.com/okex/exchain@v1.8.0/libs/tendermint/mempool/exchain_pending_pool_error.go (about)

     1  package mempool
     2  
     3  import "fmt"
     4  
     5  // ErrPendingPoolIsFull means PendingPool can't handle that much load
     6  type ErrPendingPoolIsFull struct {
     7  	size    int
     8  	maxSize int
     9  }
    10  
    11  func (e ErrPendingPoolIsFull) Error() string {
    12  	return fmt.Sprintf(
    13  		"Pending pool is full: current size %d, max size %d",
    14  		e.size, e.maxSize)
    15  }
    16  
    17  // ErrPendingPoolAddressLimit means address sending too many txs in PendingPool
    18  type ErrPendingPoolAddressLimit struct {
    19  	address string
    20  	size    int
    21  	maxSize int
    22  }
    23  
    24  func (e ErrPendingPoolAddressLimit) Error() string {
    25  	return fmt.Sprintf(
    26  		"The address %s has too many txs in pending pool, current txs count %d, max count %d",
    27  		e.address, e.size, e.maxSize,
    28  	)
    29  }
    30  
    31  // ErrTxAlreadyInPendingPool means the tx already in PendingPool
    32  type ErrTxAlreadyInPendingPool struct {
    33  	txHash string
    34  }
    35  
    36  func (e ErrTxAlreadyInPendingPool) Error() string {
    37  	return fmt.Sprintf(
    38  		"Tx %s already exists in pending pool", e.txHash,
    39  	)
    40  }