github.com/aergoio/aergo@v1.3.1/message/mempoolmsg.go (about)

     1  /**
     2   *  @file
     3   *  @copyright defined in aergo/LICENSE.txt
     4   */
     5  
     6  package message
     7  
     8  import (
     9  	"github.com/aergoio/aergo/types"
    10  )
    11  
    12  // MemPoolSvc is exported name for MemPool service
    13  const MemPoolSvc = "MemPoolSvc"
    14  
    15  // MemPoolPut is interface of MemPool service for inserting transactions
    16  type MemPoolPut struct {
    17  	Tx *types.Tx
    18  }
    19  
    20  // MemPoolPutRsp defines struct of result for MemPoolPut
    21  type MemPoolPutRsp struct {
    22  	Err error
    23  }
    24  
    25  // MemPoolGet is interface of MemPool service for retrieving transactions
    26  type MemPoolGet struct {
    27  	MaxBlockBodySize uint32
    28  }
    29  
    30  // MemPoolGetRsp defines struct of result for MemPoolGet
    31  type MemPoolGetRsp struct {
    32  	Txs []types.Transaction
    33  	Err error
    34  }
    35  
    36  // MemPoolExist is interface of MemPool service for retrieving transaction
    37  // according to given hash
    38  type MemPoolExist struct {
    39  	Hash []byte
    40  }
    41  
    42  // MemPoolExistRsp defines struct of result for MemPoolExist
    43  type MemPoolExistRsp struct {
    44  	Tx *types.Tx
    45  }
    46  
    47  const MaxReqestHashes = 1000
    48  
    49  type MemPoolExistEx struct {
    50  	Hashes [][]byte
    51  }
    52  type MemPoolExistExRsp struct {
    53  	Txs []*types.Tx
    54  }
    55  
    56  type MemPoolSetWhitelist struct {
    57  	Accounts []string
    58  }
    59  
    60  type MemPoolEnableWhitelist struct {
    61  	On bool
    62  }
    63  
    64  // MemPoolDel is interface of MemPool service for deleting transactions
    65  // including given transactions
    66  type MemPoolDel struct {
    67  	Block *types.Block
    68  }
    69  
    70  // MemPoolDelRsp defines struct of result for MemPoolDel
    71  type MemPoolDelRsp struct {
    72  	Err error
    73  }