3

I am calling a contract deployed on private blockchain. The transaction is always pending.

> txpool.status

{ pending: 1, queued: 0 }

> eth.getTransaction(eth.getBlock("pending").transactions[0])

{

blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000", blockNumber: null, from: "0x03b09e13617abb896c934207083c05d98a3d90b7", gas: 90000, gasPrice: 20000000000, hash: "0xf0c6d37bc06ef89247140700a8536eed556501e35739f55ddd23f0815979906c", input: "0x4326ee36000000000000000000000000000000000000000000000000000000000000000a", nonce: 0, r: "0x9f9cda3d33b638005c4b78da2fd671e092463270ebdb00686a828786f182222e", s: "0x21156b6f4cca83ba3787e3cc32c5ac42d69139355843565d8e619fcb94cd118c", to: "0xcc8a1779d4e953fc9b9d4ae377a9981a7cde958f", transactionIndex: 0, v: "0x1b", value: 0 }

What could be the reason for pending transactions. Thank you.

  • Is something mining on this chain? – Rob Hitchens - B9lab Jan 27 '17 at 6:42
  • its very simple setup. I have 1 mining node, I started it as following geth --mine --networkid 42 --nodiscover --maxpeers 3 console. I have another node, no mining happening on it. I exposed the contract using ABI and contract address. Before the node was started as below geth --networkid 42 --nodiscover --verbosity 5 console. On this node the transactions are always pending. – Nitin Gavhane Jan 27 '17 at 7:30
  • It's possible you have two network42's that aren't talking. They won't discover each other without a hint. Does the blocknumber on the contract node keep up with the blocknumber on mining node? eth.blockNumber. BTW, you can run a lone private node, mine, and have a quiet console to work with by reducing verbosity or just doing geth attach in another terminal. Easier to set up. – Rob Hitchens - B9lab Jan 27 '17 at 7:55
  • Thank you for the reply. The peers can discover each other. I can see that on console. The blockNumber are in sync. On both node when I print > eth.blockNumber, it gives the update to date blockNumber. When I execute the contract on mining node the transaction is processed and it achieves the desired outcome. But on other where no mining is going on the transaction always remains pending. – Nitin Gavhane Jan 27 '17 at 8:08
  • On the second node if I explicitly start mining like miner.start(10); admin.sleepBlocks(10); miner.stop(); The transaction is processed and added to blockchain. I am new to Ethereum. am I doing something wrong here? – Nitin Gavhane Jan 27 '17 at 8:15
2

I think this may be a known issue, check this out: https://github.com/ethereum/go-ethereum/issues/2769

  • Thanks for the reply. I went through the post looks like the same issue. Meanwhile I did something. I added one more transaction node. (so now I have three nodes running, only node1 is mining). I submitted a transaction from node 2 and the transaction still remains in pending state. Additionally from node3 I did miner.start(10) admin.sleepBlocks(10) miner.stop(). after a while the transaction were successfully added to blockchain. I again submitted few more transaction and they were getting successfully added to chain. Since I am learning, I want to know is this expected and does why? – Nitin Gavhane Jan 30 '17 at 6:17
  • According to the issue, it is considered a bug and will hopefully be fixed some day. So yes expected but not desired. The workaround is to start a second miner like you did to clear some internal flag that is set when a miner is first initialized – Chris Hafey Jan 30 '17 at 13:31

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.