add boolean to web3.reset()

This commit is contained in:
Fabian Vogelsteller 2015-09-15 15:52:57 +02:00
parent 0d1bcdfd2a
commit 4b3aa701b9
2 changed files with 4 additions and 4 deletions

View File

@ -109,8 +109,8 @@ web3.setProvider = function (provider) {
web3.isConnected = function(){
return (this.currentProvider && this.currentProvider.isConnected());
};
web3.reset = function () {
RequestManager.getInstance().reset();
web3.reset = function (keepIsSyncing) {
RequestManager.getInstance().reset(keepIsSyncing);
c.defaultBlock = 'latest';
c.defaultAccount = undefined;
};

View File

@ -177,11 +177,11 @@ RequestManager.prototype.stopPolling = function (pollId) {
*
* @method reset
*/
RequestManager.prototype.reset = function () {
RequestManager.prototype.reset = function (keepIsSyncing) {
for (var key in this.polls) {
// remove all polls, except sync polls,
// they need to be removed manually by calling syncing.stopWatching()
if(key.indexOf('syncPoll_') === -1) {
if(!keepIsSyncing || key.indexOf('syncPoll_') === -1) {
this.polls[key].uninstall();
delete this.polls[key];
}