0

When I send a transaction it generates hash number but the transaction index number not increased as per below. Can someone care to explain?

eth.getTransaction("0x46542d25d044f73cff4c19081284ac84623de6bcaceb1aadd0545d21cd44a056")
{
  blockHash: "0x71d79df1f93332f4cf3b239231a487ec61f4f0385447520078e51c56913fa091",
  blockNumber: 2,
  from: "0xed9d02e382b34818e88b88a309c7fe71e65f419d",
  gas: 4700000,
  gasPrice: 0,
  hash: "0x46542d25d044f73cff4c19081284ac84623de6bcaceb1aadd0545d21cd44a056",
  input: "0x4a78245865ad5c90515ab305fbdb5959abd40a8fba263eb4a30497a4c354b9a77a649c11d3e2f8cd305468fcfef474c001b7d7d5fa3fa7f482a64a3513cc5923",
  nonce: 1,
  r: "0x47e083e2d701c89eb0919733fde0163d5bdf878e46f8aa0bee300214d00b6cfd",
  s: "0x2a60267c3f549437a0fb7f474f5e00d9a2afa019cfb5b9a800875948cf14e4d7",
  to: null,
  transactionIndex: 0,
  v: "0x25",
  value: 0
}
  • Give more background about how you are running the blockchain (what client: ganache, geth, parity, ..) how you broadcasted the transaction, how do you know it was not mined. – cleanunicorn Mar 24 '18 at 8:32
1

TransactionIndex is the position of the transaction within the block it was mined in. It is not a global index.

For example if you have transactions T1, T2 in block 1; transactions T3, T4, T5 in block 2 and T6 in block 3.

  • T1 have transactionIndex 0 in block 1, T2 have transactionIndex 1 in block 1.
  • T3 have transactionIndex 0 in block 2, .. T5 have transactionIndex 2 in block 2.
  • T6 have transactionIndex 0 in block 3
0

Having blockNumber and blockHash in the response means that the transaction was mined and included in in that specific block

Having to null means your transaction tried to create a contract

Is it possible that your transaction created an error and that's why you think it wasn't mined?

What does the receipt look like? Try running

eth.getTransactionReceipt("0x46542d25d044f73cff4c19081284ac84623de6bcaceb1aadd0545d21cd44a056")
  • eth.getTransactionReceipt("0x46542d25d044f73cff4c19081284ac84623de6bcaceb1aadd0545d21cd44a056") { blockHash: "0x71d79df1f93332f4cf3b239231a487ec61f4f0385447520078e51c56913fa091", blockNumber: 2, contractAddress: "0x1349f3e1b8d71effb47b840594ff27da7e603d17", cumulativeGasUsed: 0, from: "0xed9d02e382b34818e88b88a309c7fe71e65f419d", gasUsed: 0, logs: [], logsBloom: "0x0", root: "0x7776acd97aa1631c6df28a9572bd9bb6a861b13ac61dc0b30cbfea529529b11c", to: null, transactionHash: "hash value", transactionIndex: 0 } – Block Chain Mar 24 '18 at 14:35

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.