Content returns the transactions contained within the transaction pool.
()
| 101 | |
| 102 | // Content returns the transactions contained within the transaction pool. |
| 103 | func (s *PublicTxPoolAPI) Content() map[string]map[string]map[string]*RPCTransaction { |
| 104 | content := map[string]map[string]map[string]*RPCTransaction{ |
| 105 | "pending": make(map[string]map[string]*RPCTransaction), |
| 106 | "queued": make(map[string]map[string]*RPCTransaction), |
| 107 | } |
| 108 | pending, queue := s.b.TxPoolContent() |
| 109 | |
| 110 | // Flatten the pending transactions |
| 111 | for account, txs := range pending { |
| 112 | dump := make(map[string]*RPCTransaction) |
| 113 | for _, tx := range txs { |
| 114 | dump[fmt.Sprintf("%d", tx.Nonce())] = newRPCPendingTransaction(tx) |
| 115 | } |
| 116 | content["pending"][account.Hex()] = dump |
| 117 | } |
| 118 | // Flatten the queued transactions |
| 119 | for account, txs := range queue { |
| 120 | dump := make(map[string]*RPCTransaction) |
| 121 | for _, tx := range txs { |
| 122 | dump[fmt.Sprintf("%d", tx.Nonce())] = newRPCPendingTransaction(tx) |
| 123 | } |
| 124 | content["queued"][account.Hex()] = dump |
| 125 | } |
| 126 | return content |
| 127 | } |
| 128 | |
| 129 | // Status returns the number of pending and queued transaction in the pool. |
| 130 | func (s *PublicTxPoolAPI) Status() map[string]hexutil.Uint { |
nothing calls this directly
no test coverage detected