@@ -1301,22 +1301,27 @@ func (s *PublicTransactionPoolAPI) SignTransaction(ctx context.Context, args Sen
1301
1301
return & SignTransactionResult {data , tx }, nil
1302
1302
}
1303
1303
1304
- // PendingTransactions returns the transactions that are in the transaction pool and have a from address that is one of
1305
- // the accounts this node manages.
1304
+ // PendingTransactions returns the transactions that are in the transaction pool
1305
+ // and have a from address that is one of the accounts this node manages.
1306
1306
func (s * PublicTransactionPoolAPI ) PendingTransactions () ([]* RPCTransaction , error ) {
1307
1307
pending , err := s .b .GetPoolTransactions ()
1308
1308
if err != nil {
1309
1309
return nil , err
1310
1310
}
1311
-
1311
+ accounts := make (map [common.Address ]struct {})
1312
+ for _ , wallet := range s .b .AccountManager ().Wallets () {
1313
+ for _ , account := range wallet .Accounts () {
1314
+ accounts [account .Address ] = struct {}{}
1315
+ }
1316
+ }
1312
1317
transactions := make ([]* RPCTransaction , 0 , len (pending ))
1313
1318
for _ , tx := range pending {
1314
1319
var signer types.Signer = types.HomesteadSigner {}
1315
1320
if tx .Protected () {
1316
1321
signer = types .NewEIP155Signer (tx .ChainId ())
1317
1322
}
1318
1323
from , _ := types .Sender (signer , tx )
1319
- if _ , err := s . b . AccountManager (). Find ( accounts. Account { Address : from }); err == nil {
1324
+ if _ , exists := accounts [ from ]; exists {
1320
1325
transactions = append (transactions , newRPCPendingTransaction (tx ))
1321
1326
}
1322
1327
}
0 commit comments