My understanding is that the lib's wsProvider.on('pending') method acts as a wrapper around the appropriate geth json-rpc method to listen for transactions in the mempool (pending transactions).
I tried to dig up documentation on this rpc method, but could not get what I was looking for.
I wish to clarify: -
Does the listener only pick up NEW transactions that enter the pool after it is activated? How about transactions that were already in the pool when the listener was activated?
In case the answer to Question 1 is that the listener gives all the transactions in the pool, not just new entrants, then what happens if a transaction leaves the pool after the the listener is activated? Does the listener simply never pick up that transaction?
How accurate is the listener? Does it pick up ALL new transactions?