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.accounts = AccountParser.parseAccountsConfig(self.accountsConfig, self.web3, self.logger);
|
||||||
self.addresses = [];
|
self.addresses = [];
|
||||||
|
|
||||||
if (!self.accounts.length) {
|
if (!self.accounts.length) {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
@ -75,20 +76,31 @@ class Provider {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
self.realAccountFunction((err, accounts) => {
|
self.realAccountFunction((err, accounts) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
cb(err);
|
return cb(err);
|
||||||
return reject(err);
|
|
||||||
}
|
}
|
||||||
accounts = accounts.concat(self.addresses);
|
accounts = accounts.concat(self.addresses);
|
||||||
// accounts = self.addresses.concat(accounts);
|
// accounts = self.addresses.concat(accounts);
|
||||||
cb(null, accounts);
|
cb(null, accounts);
|
||||||
resolve(accounts);
|
resolve(accounts);
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
|
realSend(payload, cb);
|
||||||
};
|
};
|
||||||
|
|
||||||
callback();
|
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) {
|
fundAccounts(callback) {
|
||||||
const self = this;
|
const self = this;
|
||||||
if (!self.accounts.length) {
|
if (!self.accounts.length) {
|
||||||
|
|
Loading…
Reference in New Issue