Skip to content

Commit 673c92d

Browse files
committed
internal/ethapi: fix tx nonces in pool inspect/content
1 parent cb809c0 commit 673c92d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

internal/ethapi/api.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,16 +118,16 @@ func (s *PublicTxPoolAPI) Content() map[string]map[string]map[string]*RPCTransac
118118
// Flatten the pending transactions
119119
for account, txs := range pending {
120120
dump := make(map[string]*RPCTransaction)
121-
for nonce, tx := range txs {
122-
dump[fmt.Sprintf("%d", nonce)] = newRPCPendingTransaction(tx)
121+
for _, tx := range txs {
122+
dump[fmt.Sprintf("%d", tx.Nonce())] = newRPCPendingTransaction(tx)
123123
}
124124
content["pending"][account.Hex()] = dump
125125
}
126126
// Flatten the queued transactions
127127
for account, txs := range queue {
128128
dump := make(map[string]*RPCTransaction)
129-
for nonce, tx := range txs {
130-
dump[fmt.Sprintf("%d", nonce)] = newRPCPendingTransaction(tx)
129+
for _, tx := range txs {
130+
dump[fmt.Sprintf("%d", tx.Nonce())] = newRPCPendingTransaction(tx)
131131
}
132132
content["queued"][account.Hex()] = dump
133133
}
@@ -162,16 +162,16 @@ func (s *PublicTxPoolAPI) Inspect() map[string]map[string]map[string]string {
162162
// Flatten the pending transactions
163163
for account, txs := range pending {
164164
dump := make(map[string]string)
165-
for nonce, tx := range txs {
166-
dump[fmt.Sprintf("%d", nonce)] = format(tx)
165+
for _, tx := range txs {
166+
dump[fmt.Sprintf("%d", tx.Nonce())] = format(tx)
167167
}
168168
content["pending"][account.Hex()] = dump
169169
}
170170
// Flatten the queued transactions
171171
for account, txs := range queue {
172172
dump := make(map[string]string)
173-
for nonce, tx := range txs {
174-
dump[fmt.Sprintf("%d", nonce)] = format(tx)
173+
for _, tx := range txs {
174+
dump[fmt.Sprintf("%d", tx.Nonce())] = format(tx)
175175
}
176176
content["queued"][account.Hex()] = dump
177177
}

0 commit comments

Comments
 (0)