@@ -175,6 +175,29 @@ func (s *PublicTxPoolAPI) Content() map[string]map[string]map[string]*RPCTransac
175175 return content
176176}
177177
178+ // ContentFrom returns the transactions contained within the transaction pool.
179+ func (s * PublicTxPoolAPI ) ContentFrom (addr common.Address ) map [string ]map [string ]* RPCTransaction {
180+ content := make (map [string ]map [string ]* RPCTransaction , 2 )
181+ pending , queue := s .b .TxPoolContentFrom (addr )
182+ curHeader := s .b .CurrentHeader ()
183+
184+ // Build the pending transactions
185+ dump := make (map [string ]* RPCTransaction , len (pending ))
186+ for _ , tx := range pending {
187+ dump [fmt .Sprintf ("%d" , tx .Nonce ())] = newRPCPendingTransaction (tx , curHeader , s .b .ChainConfig ())
188+ }
189+ content ["pending" ] = dump
190+
191+ // Build the queued transactions
192+ dump = make (map [string ]* RPCTransaction , len (queue ))
193+ for _ , tx := range queue {
194+ dump [fmt .Sprintf ("%d" , tx .Nonce ())] = newRPCPendingTransaction (tx , curHeader , s .b .ChainConfig ())
195+ }
196+ content ["queued" ] = dump
197+
198+ return content
199+ }
200+
178201// Status returns the number of pending and queued transaction in the pool.
179202func (s * PublicTxPoolAPI ) Status () map [string ]hexutil.Uint {
180203 pending , queue := s .b .Stats ()
0 commit comments