-
Notifications
You must be signed in to change notification settings - Fork 158
Use SDK Gossip #318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use SDK Gossip #318
Changes from 28 commits
2fdd559
ca37577
c93ee73
bb513d6
cdb9649
33b8a06
845b93d
76cc2d2
954f60f
c83364f
021f8bf
8c56141
90398eb
673f5ab
234bdb1
61a1c16
2898ee5
248a1ca
0393cfb
474a03c
844ccd2
db51063
fbfa372
ec525c9
25d0bf3
78698af
6d8f21e
d4b722c
2094e8d
fe04ca8
678f640
d487de1
0c5a462
0e34744
461170e
5a9a7e7
1ffc8e2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -630,6 +630,21 @@ func (pool *TxPool) PendingSize() int { | |
return count | ||
} | ||
|
||
// IteratePending iterates over [pool.pending] until [f] returns false. | ||
// The caller must not modify [tx]. | ||
func (pool *TxPool) IteratePending(f func(tx *types.Transaction) bool) { | ||
pool.mu.RLock() | ||
defer pool.mu.RUnlock() | ||
|
||
for _, list := range pool.pending { | ||
for _, tx := range list.txs.items { | ||
if !f(tx) { | ||
return | ||
} | ||
} | ||
} | ||
Comment on lines
+639
to
+645
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to prioritize transactions by nonce or perhaps local addresses? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good, the other concern would be if we end up sending only transactions with future nonces and don't include the necessary transaction to make them executable. This is an edge case when we hit the max size, so I don't think this needs to block the PR. |
||
} | ||
|
||
// Locals retrieves the accounts currently considered local by the pool. | ||
func (pool *TxPool) Locals() []common.Address { | ||
pool.mu.Lock() | ||
|
Uh oh!
There was an error while loading. Please reload this page.