|
|
@ -175,6 +175,29 @@ func (s *PublicTxPoolAPI) Content() map[string]map[string]map[string]*RPCTransac |
|
|
|
return content |
|
|
|
return content |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ContentFrom returns the transactions contained within the transaction pool.
|
|
|
|
|
|
|
|
func (s *PublicTxPoolAPI) ContentFrom(addr common.Address) map[string]map[string]*RPCTransaction { |
|
|
|
|
|
|
|
content := make(map[string]map[string]*RPCTransaction, 2) |
|
|
|
|
|
|
|
pending, queue := s.b.TxPoolContentFrom(addr) |
|
|
|
|
|
|
|
curHeader := s.b.CurrentHeader() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build the pending transactions
|
|
|
|
|
|
|
|
dump := make(map[string]*RPCTransaction, len(pending)) |
|
|
|
|
|
|
|
for _, tx := range pending { |
|
|
|
|
|
|
|
dump[fmt.Sprintf("%d", tx.Nonce())] = newRPCPendingTransaction(tx, curHeader, s.b.ChainConfig()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
content["pending"] = dump |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Build the queued transactions
|
|
|
|
|
|
|
|
dump = make(map[string]*RPCTransaction, len(queue)) |
|
|
|
|
|
|
|
for _, tx := range queue { |
|
|
|
|
|
|
|
dump[fmt.Sprintf("%d", tx.Nonce())] = newRPCPendingTransaction(tx, curHeader, s.b.ChainConfig()) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
content["queued"] = dump |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return content |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Status returns the number of pending and queued transaction in the pool.
|
|
|
|
// Status returns the number of pending and queued transaction in the pool.
|
|
|
|
func (s *PublicTxPoolAPI) Status() map[string]hexutil.Uint { |
|
|
|
func (s *PublicTxPoolAPI) Status() map[string]hexutil.Uint { |
|
|
|
pending, queue := s.b.Stats() |
|
|
|
pending, queue := s.b.Stats() |
|
|
|