2

I've compiled a version of geth where I modified CalcDifficulty() in core/block_validator.go to make mining difficulty constant, see reference. Starting up the private chain, creating accounts and mining works fine.

If I try via the javascript console to unlock an account, it works, and returns true.

personal.unlockAccount(eth.accounts[0])

But when I try to send a transaction:

personal.sendTransaction({from:eth.accounts[0], to: eth.accounts[1], value: 20000000})

I get the following:

Error: could not decrypt key with given passphrase
    at web3.js:3104:20
    at web3.js:6191:15
    at web3.js:5004:36
    at <anonymous>:1:1
  • can confirm, I'm also seeing this issue. also on a testnet, without having modified my geth client (Geth/v1.6.6-stable-10a45cb5/linux-amd64/go1.8.1) – roo2 Jul 10 '17 at 5:55
  • I raised this geth bug github.com/ethereum/go-ethereum/issues/14780 – roo2 Jul 10 '17 at 6:23
3

The personal.sendTransaction method expects a second argument, the password to ephemerally unlock the account with and send the transaction in one go. If you don't provide a password, this endpoint defaults to the empty password, resulting in your issue.

If you want to use an already unlocked account to send a transaction (instead of the ephemeral unlock-and-send), you can do so with eth.sendTransaction.

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.