Skip to content

Commit

Permalink
Merge pull request bitcoin#11 from bitgreen/mymn-tab
Browse files Browse the repository at this point in the history
Add my masternode option and allow different ports.
  • Loading branch information
barrystyle committed Oct 29, 2019
2 parents 3559426 + c756293 commit 8e69d7a
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class CMainParams : public CChainParams
fRequireStandard = true;
m_is_test_chain = false;
fMiningRequiresPeers = true;
fAllowMultiplePorts = false;
fAllowMultiplePorts = true;
nFulfilledRequestExpireTime = 60*60; // fulfilled requests expire in 1 hour

vSporkAddresses = {"GTKdD1S9HrSbT8Puvsh7nTdXEokictDXE2"};
Expand Down
14 changes: 14 additions & 0 deletions src/qt/forms/debugwindow.ui
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,20 @@
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="masternodeCountLabel">
<property name="text">
<string>Number of Masternodes</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLabel" name="masternodeCount">
<property name="text">
<string>N/A</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_10">
<property name="font">
Expand Down
10 changes: 10 additions & 0 deletions src/qt/forms/masternodelist.ui
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBoxMyMasternodesOnly">
<property name="toolTip">
<string>Show only masternodes this wallet has keys for.</string>
</property>
<property name="text">
<string>My masternodes only</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
Expand Down
18 changes: 17 additions & 1 deletion src/qt/masternodelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,24 @@ void MasternodeList::updateDIP3List()
nextPayments.emplace(dmn->proTxHash, mnList.GetHeight() + (int)i + 1);
}

mnList.ForEachMN(false, [&](const CDeterministicMNCPtr& dmn) {
std::set<COutPoint> setOutpts;
if (walletModel && ui->checkBoxMyMasternodesOnly->isChecked()) {
std::vector<COutPoint> vOutpts;
walletModel->listProTxCoins(vOutpts);
for (const auto& outpt : vOutpts) {
setOutpts.emplace(outpt);
}
}

mnList.ForEachMN(false, [&](const CDeterministicMNCPtr& dmn) {
if (walletModel && ui->checkBoxMyMasternodesOnly->isChecked()) {
bool fMyMasternode = setOutpts.count(dmn->collateralOutpoint) ||
walletModel->havePrivKey(dmn->pdmnState->keyIDOwner) ||
walletModel->havePrivKey(dmn->pdmnState->keyIDVoting) ||
walletModel->havePrivKey(dmn->pdmnState->scriptPayout) ||
walletModel->havePrivKey(dmn->pdmnState->scriptOperatorPayout);
if (!fMyMasternode) return;
}
// populate list
// Address, Protocol, Status, Active Seconds, Last Seen, Pub Key
QTableWidgetItem* addressItem = new QTableWidgetItem(QString::fromStdString(dmn->pdmnState->addr.ToString()));
Expand Down

0 comments on commit 8e69d7a

Please sign in to comment.