mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 13:21:37 +00:00
cmd/devp2p/ethtest: fix swapped args in private-key error message
The error "unable to read private key for %s: %v" passed (err, addr), so it printed the decode error where the account address belongs and the address where the error belongs. Swap to (addr, err) so the message names the account that failed and then the reason.
This commit is contained in:
parent
7c9032dff6
commit
abfa0e60c4
1 changed files with 1 additions and 1 deletions
|
|
@ -335,7 +335,7 @@ func readAccounts(file string) (map[common.Address]*senderInfo, error) {
|
||||||
for addr, acc := range keys {
|
for addr, acc := range keys {
|
||||||
pk, err := crypto.HexToECDSA(common.Bytes2Hex(acc.Key))
|
pk, err := crypto.HexToECDSA(common.Bytes2Hex(acc.Key))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("unable to read private key for %s: %v", err, addr)
|
return nil, fmt.Errorf("unable to read private key for %s: %v", addr, err)
|
||||||
}
|
}
|
||||||
accounts[addr] = &senderInfo{Key: pk, Nonce: 0}
|
accounts[addr] = &senderInfo{Key: pk, Nonce: 0}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue