fix webserver errors
This commit is contained in:
parent
62c46063b3
commit
7e16691aa6
|
@ -58,6 +58,7 @@ class Provider {
|
|||
|
||||
self.accounts = AccountParser.parseAccountsConfig(self.accountsConfig, self.web3, self.logger);
|
||||
self.addresses = [];
|
||||
|
||||
if (!self.accounts.length) {
|
||||
return callback();
|
||||
}
|
||||
|
@ -75,20 +76,31 @@ class Provider {
|
|||
return new Promise((resolve, reject) => {
|
||||
self.realAccountFunction((err, accounts) => {
|
||||
if (err) {
|
||||
cb(err);
|
||||
return reject(err);
|
||||
return cb(err);
|
||||
}
|
||||
accounts = accounts.concat(self.addresses);
|
||||
// accounts = self.addresses.concat(accounts);
|
||||
cb(null, accounts);
|
||||
resolve(accounts);
|
||||
});
|
||||
});
|
||||
}
|
||||
realSend(payload, cb);
|
||||
};
|
||||
|
||||
callback();
|
||||
}
|
||||
|
||||
stop() {
|
||||
if (this.provider && this.provider.removeAllListeners) {
|
||||
this.provider.removeAllListeners('connect');
|
||||
this.provider.removeAllListeners('error');
|
||||
this.provider.removeAllListeners('end');
|
||||
this.provider.removeAllListeners('data');
|
||||
this.provider.responseCallbacks = {};
|
||||
this.provider = null;
|
||||
}
|
||||
}
|
||||
|
||||
fundAccounts(callback) {
|
||||
const self = this;
|
||||
if (!self.accounts.length) {
|
||||
|
|
Loading…
Reference in New Issue