2

I read official manual

What the difference between this

web3.eth.filter({'fromBlock': 'pending', 'toBlock': 'latest'})

and this?

web3.eth.filter('latest')
1

web3.eth.filter({'fromBlock': 'pending', 'toBlock': 'latest'})

When you call get or watch on this filter, you will get event logs of events occurring between fromBlock and toBlock. Since 'latest' is a moving pointer, you'll get event logs from future blocks too.

web3.eth.filter('latest')

when you call watch on this filter, you will get the block hash of the latest block.

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.