Find PendingIterator in Transaction Pool#218
Conversation
tomusdrw
left a comment
There was a problem hiding this comment.
Looks good, small style grumble and it would be really good to add a test for it.
| }, | ||
| _ => trace!("[{:?}] Ignoring {:?} transaction.", best.transaction.hash(), tx_state), | ||
|
|
||
| if tx_state == Readiness::Ready { |
There was a problem hiding this comment.
I've actually meant to put the if inside previous match and leave the trace in _ pattern, but this is fine as well.
Just got an idea that for readability we could also change both this if and match above to if let, but it's up to you.
There was a problem hiding this comment.
I thought it would be clearer to have one match when we need to find the next transactions, and another one when we need to return the transaction, but I'm open to anything :)
There was a problem hiding this comment.
My reasoning was that it's easier to see everything that happens in particular case(ses) in a single block, cause now you fall-through and need to analyze multiple blocks to think about what happens. But as I said, I'm not strong on this either.
When encountering a
Staletransaction in thePendingIterator, we should try to use the next best transaction for this sender.