5

It seems I've made a successful transaction from account[0] to account1. Why does account1 still have a 0 balance?

> var sender = eth.accounts[0];
undefined
> sender
"0x702543f4ae6d7ebdd07dc29c432a0c707b8c2cc0"
> var receiver = eth.accounts[1];
undefined
> receiver
"0xac97d0feb8b4b3bcaa2b153dff1d4eaa5b4bee9c"
> var amount = web3.toWei(1000, 'ether');
undefined
> eth.sendTransaction({from:sender, to:receiver, value: amount})
account is locked
    at web3.js:3119:20
    at web3.js:6023:15
    at web3.js:4995:36
    at <anonymous>:1:1

> personal.unlockAccount(sender, "valid_passphrase")
true
> personal.unlockAccount(receiver, "valid_passphase")
true

> eth.sendTransaction({from:sender, to:receiver, value: amount})
I0602 20:32:38.038644 eth/api.go:1193] Tx(0xa7c9e4af88ca93f8bd3c488ed0807da3ec5879456cce9a3093a690a3ccb1dba8) to: 0xac97d0feb8b4b3bcaa2b153dff1d4eaa5b4bee9c
"0xa7c9e4af88ca93f8bd3c488ed0807da3ec5879456cce9a3093a690a3ccb1dba8"


> eth.getBalance(eth.accounts[0])
6.79703125e+21
> eth.getBalance(eth.accounts[1])
0

eth.getTransaction("0xa7c9e4af88ca93f8bd3c488ed0807da3ec5879456cce9a3093a690a3ccb1dba8")

{
  blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
  blockNumber: null,
  from: "0x702543f4ae6d7ebdd07dc29c432a0c707b8c2cc0",
  gas: 90000,
  gasPrice: 20000000000,
  hash: "0xa7c9e4af88ca93f8bd3c488ed0807da3ec5879456cce9a3093a690a3ccb1dba8",
  input: "0x",
  nonce: 0,
  to: "0xac97d0feb8b4b3bcaa2b153dff1d4eaa5b4bee9c",
  transactionIndex: null,
  value: 1e+21
}

SOLUTION:

miner.start(8)

Let the miner run for a couple minutes.

miner.stop()

eth.getTransaction("0xa7c9e4af88ca93f8bd3c488ed0807da3ec5879456cce9a3093a690a3ccb1dba8")

{
  blockHash: "0xea06bc12fc1db50416adc90ec0856946f3e69b6bba3ec6722ecaf04538184667",
  blockNumber: 1330,
  from: "0x702543f4ae6d7ebdd07dc29c432a0c707b8c2cc0",
  gas: 90000,
  gasPrice: 20000000000,
  hash: "0xa7c9e4af88ca93f8bd3c488ed0807da3ec5879456cce9a3093a690a3ccb1dba8",
  input: "0x",
  nonce: 0,
  to: "0xac97d0feb8b4b3bcaa2b153dff1d4eaa5b4bee9c",
  transactionIndex: 0,
  value: 1e+21
}
7
  • Can you try eth.getTransaction("0xa7c9e4af88ca93f8bd3c488ed0807da3ec5879456cce9a3093a690a3ccb1dba8") and confirm that the transaction was mined? Jun 3, 2016 at 1:12
  • looks like it wasn't mined because the block number is null... Jun 3, 2016 at 1:25
  • I made the transaction in the geth console, while the miner was stopped. If I start the miner, should it eventually mine this transaction? Jun 3, 2016 at 1:26
  • It should if the transaction is still floating around in the transaction pool. If you shut down all your geth instances, the transaction will be lost. Jun 3, 2016 at 1:26
  • probably a silly question, how can I run multiple nodes on a local chain? Jun 3, 2016 at 1:29

1 Answer 1

2

miner.start(8)

Let the miner run for a couple minutes.

miner.stop()

eth.getTransaction("0xa7c9e4af88ca93f8bd3c488ed0807da3ec5879456cce9a3093a690a3ccb1dba8")

{
  blockHash: "0xea06bc12fc1db50416adc90ec0856946f3e69b6bba3ec6722ecaf04538184667",
  blockNumber: 1330,
  from: "0x702543f4ae6d7ebdd07dc29c432a0c707b8c2cc0",
  gas: 90000,
  gasPrice: 20000000000,
  hash: "0xa7c9e4af88ca93f8bd3c488ed0807da3ec5879456cce9a3093a690a3ccb1dba8",
  input: "0x",
  nonce: 0,
  to: "0xac97d0feb8b4b3bcaa2b153dff1d4eaa5b4bee9c",
  transactionIndex: 0,
  value: 1e+21
}

Your Answer

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

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