I am new in ethereum, I just run simple node.js program and using web3 api, and I send some ether from my account to another in my private ethereum network, after mining my transactions mined. I still have some pending transactions, my problem is that when I want to get the number of pending transactions by following code it has the error:

Cannot read property 'length' of undefined

, howeverو I can query the pending transactions numbers via geth javascript console by this query: eth.pendingTransactions.length


Also, I used getPendingTransactions function with call back but still it has the same error.

I checked for some other functions and variables it works fine I do not know what is the problem with array of pendingTransaction and function getPendingTransactions.

Here is my simple code:

var Web3 = require('web3');
var web3 = new Web3(new Web3.providers.HttpProvider(''));
var hashstring = web3.eth.sendTransaction({from: "X", to: "Y", value: web3.toWei(10, 'ether'),gas:30000});
  • Maybe helpful if you post your actual failing code? Jan 23, 2017 at 0:55
  • I just moved the code into the question for clarity. Jan 23, 2017 at 1:52

1 Answer 1


web3.eth.pendingTransactions seems to be a Geth internal addition, I do not see it in the JSON-RPC or Web3 standard.

You are probably better off using this:

    function (error, block) {
        if (error) {
        } else {

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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