4

I run this code using MetaMask to inject web3 object:

var filter = web3.eth.filter('pending');
filter.watch(function (error, log) {
  console.log(log);  
});

From web3 api docs:

When using the "pending" parameter, it returns a transaction hash of the last add pending transaction.

My log looks like this:

enter image description here

I can't fing anything that would look like a transaction hash of the last add pending transaction.

I'm not sure if it's an issue with MetaMask. Could anyone running the node please run this code and post here the log?

2

From a question about pending:

Pending is the collection of transactions that can be executed by the network (that your own node knows about), but have not yet been done so.

If your node sends a transaction, you should see its transaction hash being logged. Send a second transaction, and you should see its hash.

This documentation may be clearer as: When using the "pending" parameter, it returns a transaction hash of the most recent pending transaction.

  • 1
    Thank you so much!!! Just to be clear, this code logs the last pending transactions that only my node sends? Is there a way to log the pending transactions that other nodes send? – manidos Aug 9 '16 at 10:49
  • I think it should also log pending transactions that other nodes send to your node. – eth Aug 9 '16 at 17:42
  • As it turned out, the problem was that MetaMask doesn't support "pending" filters yet. When I connected to Geth at local host everything worked just fine. – manidos Aug 9 '16 at 18:33
  • @EugeneEpifanov Thank you for clarifying that the current issue is lack of support from MetaMask; hopefully they will fix in time. – eth Aug 9 '16 at 22:47

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.