When using web3.eth.filter, will I be getting only confirmed transactions back?


When using web3.eth.filter with the .get() method, you will receive all the past events in your current blockchain. These are "confirmed" transactions, but chain forks and reorganisations can occur that will result in the recent transactions being removed or included into a different block.

If you are using the filter .watch() functions, you will receive transactions listed as they are included in new blocks, with removed=false.

If a chain fork and reorganisation occurs, a transaction that was present in the your old chain and not present in your new chain will be listed by the filter, with removed=true.

If the same transaction is later included into your new chain, your filter watch command will list the transaction with removed=false.

See also https://ethereum.stackexchange.com/a/10739/1268.

Update: Remember to call the .stopWatching() method after you have finished using the filter. The filters will automatically expire anyway, but it may be better to manually clean up.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.