Skip to content

Commit

Permalink
clear votingMasternodes when updating conf
Browse files Browse the repository at this point in the history
  • Loading branch information
gpdionisio committed Jul 6, 2018
1 parent 4d5157e commit cc4eb4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/mainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,13 @@ def onTabChange(self):
self.t_rewards.loadMnSelect()
self.t_rewards.selectedRewards = None

# reload proposal list
# reload proposal and voting masternode list
if self.tabs.currentWidget() == self.tabGovernance:
self.t_governance.onRefreshProposals()
self.t_governance.updateSelectedMNlabel()





@pyqtSlot()
def onToggleConsole(self):
if self.btn_consoleToggle.text() == 'Hide':
Expand Down
9 changes: 8 additions & 1 deletion src/tabMNConf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ipaddress import ip_address
sys.path.append(os.path.join(os.path.dirname(__file__), 'src'))
from misc import printDbg, printOK, writeToFile
from constants import masternodes_File
from constants import masternodes_File, cache_File
from pivx_hashlib import generate_privkey

from PyQt5.QtCore import pyqtSlot
Expand Down Expand Up @@ -284,6 +284,7 @@ def onSaveMNConf(self):
printDbg("saving MN configuration for %s" % new_masternode['name'])
writeToFile(self.caller.masternode_list, masternodes_File)
printDbg("saved")

# Insert item in list of Main tab and connect buttons
name = new_masternode['name']
namelist = [x['name'] for x in self.caller.masternode_list]
Expand All @@ -295,6 +296,12 @@ def onSaveMNConf(self):
self.caller.tabMain.btn_edit[name].clicked.connect(lambda: self.caller.t_main.onEditMN())
self.caller.tabMain.btn_start[name].clicked.connect(lambda: self.caller.t_main.onStartMN())
self.caller.tabMain.btn_rewards[name].clicked.connect(lambda: self.caller.t_main.onRewardsMN())

# Clear voting masternodes configuration and update cache
self.caller.t_governance.votingMasternodes = []
self.caller.parent.cache['votingMasternodes'] = []
writeToFile(self.caller.parent.cache, cache_File)

# go back
self.onCancelMNConfig()

Expand Down

0 comments on commit cc4eb4c

Please sign in to comment.