Add message warning user a password is needed to unlock

When `mineWhenNeeded` is true (occurs in zero-config) and an account on the node exists, a password is required to be specified `config/blockchain.js > account > password` so that the existing account can be unlocked by geth (the `—unlock` cli option).
This commit is contained in:
emizzle 2018-10-15 14:21:26 +11:00 committed by Pascal Precht
parent 898ecfe293
commit 5fe746df51
No known key found for this signature in database
GPG Key ID: 0EE28D8D6FD85D7D

View File

@ -282,6 +282,9 @@ class GethClient {
accountAddress = address; accountAddress = address;
} }
if (accountAddress) { if (accountAddress) {
if(!(self.config && self.config.account && self.config.account.password)){
console.warn(__("\n===== Password needed =====\nPassword for account {{account}} not found. Unlocking this account may fail. Please ensure a password is specified in config/blockchain.js > {{env}} > account > password.\n", {account: address, env: self.env}));
}
args.push("--unlock=" + accountAddress); args.push("--unlock=" + accountAddress);
return callback(null, "--unlock=" + accountAddress); return callback(null, "--unlock=" + accountAddress);
} }