@@ -202,6 +202,29 @@ func (s *PublicTxPoolAPI) Content() map[string]map[string]map[string]*RPCTransac
202
202
return content
203
203
}
204
204
205
+ // ContentFrom returns the transactions contained within the transaction pool.
206
+ func (s * PublicTxPoolAPI ) ContentFrom (addr common.Address ) map [string ]map [string ]* RPCTransaction {
207
+ content := make (map [string ]map [string ]* RPCTransaction , 2 )
208
+ pending , queue := s .b .TxPoolContentFrom (addr )
209
+ curHeader := s .b .CurrentHeader ()
210
+
211
+ // Build the pending transactions
212
+ dump := make (map [string ]* RPCTransaction , len (pending ))
213
+ for _ , tx := range pending {
214
+ dump [fmt .Sprintf ("%d" , tx .Nonce ())] = newRPCPendingTransaction (tx , curHeader , s .b .ChainConfig ())
215
+ }
216
+ content ["pending" ] = dump
217
+
218
+ // Build the queued transactions
219
+ dump = make (map [string ]* RPCTransaction , len (queue ))
220
+ for _ , tx := range queue {
221
+ dump [fmt .Sprintf ("%d" , tx .Nonce ())] = newRPCPendingTransaction (tx , curHeader , s .b .ChainConfig ())
222
+ }
223
+ content ["queued" ] = dump
224
+
225
+ return content
226
+ }
227
+
205
228
// Status returns the number of pending and queued transaction in the pool.
206
229
func (s * PublicTxPoolAPI ) Status () map [string ]hexutil.Uint {
207
230
pending , queue := s .b .Stats ()
0 commit comments