Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RPC + UI update #10

Merged
merged 3 commits into from
Mar 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1738,6 +1738,9 @@ build/addresstablemodel.o: src/qt/addresstablemodel.cpp src/qt/addresstablemodel

build/optionsdialog.o: src/qt/optionsdialog.cpp src/qt/optionsdialog.h \
build/ui_optionsdialog.h \
src/qt/bitcoinamountfield.h \
src/qt/qvalidatedlineedit.h \
src/qt/qvaluecombobox.h \
src/qt/bitcoinunits.h \
src/qt/monitoreddatamapper.h \
src/netbase.h \
Expand Down Expand Up @@ -1805,6 +1808,7 @@ build/sendcoinsdialog.o: src/qt/sendcoinsdialog.cpp src/qt/sendcoinsdialog.h \

build/coincontroldialog.o: src/qt/coincontroldialog.cpp src/qt/coincontroldialog.h \
build/ui_coincontroldialog.h \
src/qt/coincontroltreewidget.h \
src/init.h \
src/wallet.h \
src/walletdb.h \
Expand Down Expand Up @@ -1870,6 +1874,7 @@ build/addressbookpage.o: src/qt/addressbookpage.cpp src/qt/addressbookpage.h \

build/signverifymessagedialog.o: src/qt/signverifymessagedialog.cpp src/qt/signverifymessagedialog.h \
build/ui_signverifymessagedialog.h \
src/qt/qvalidatedlineedit.h \
src/qt/addressbookpage.h \
src/base58.h \
src/chainparams.h \
Expand Down Expand Up @@ -3533,6 +3538,7 @@ build/timedata.o: src/timedata.cpp src/timedata.h \

build/overviewpage.o: src/qt/overviewpage.cpp src/qt/overviewpage.h \
build/ui_overviewpage.h \
src/qt/qcustomplot.h \
src/qt/clientmodel.h \
src/darksend.h \
src/main.h \
Expand Down Expand Up @@ -3629,6 +3635,8 @@ build/crypter.o: src/crypter.cpp src/crypter.h \

build/sendcoinsentry.o: src/qt/sendcoinsentry.cpp src/qt/sendcoinsentry.h \
build/ui_sendcoinsentry.h \
src/qt/bitcoinamountfield.h \
src/qt/qvalidatedlineedit.h \
src/qt/guiutil.h \
src/qt/bitcoinunits.h \
src/qt/addressbookpage.h \
Expand Down Expand Up @@ -3763,6 +3771,7 @@ build/paymentserver.o: src/qt/paymentserver.cpp src/qt/paymentserver.h \

build/rpcconsole.o: src/qt/rpcconsole.cpp src/qt/rpcconsole.h \
build/ui_rpcconsole.h \
src/qt/trafficgraphwidget.h \
src/qt/clientmodel.h \
src/qt/guiutil.h \
src/rpcserver.h \
Expand Down Expand Up @@ -4447,9 +4456,9 @@ build/smessage.o: src/smessage.cpp src/smessage.h \

build/messagepage.o: src/qt/messagepage.cpp src/qt/messagepage.h \
build/ui_messagepage.h \
src/qt/sendmessagesdialog.h \
src/qt/plugins/mrichtexteditor/mrichtextedit.h \
build/ui_mrichtextedit.h \
src/qt/sendmessagesdialog.h \
src/qt/messagemodel.h \
src/uint256.h \
src/allocators.h \
Expand Down Expand Up @@ -4568,6 +4577,7 @@ build/messagemodel.o: src/qt/messagemodel.cpp src/qt/guiutil.h \

build/sendmessagesdialog.o: src/qt/sendmessagesdialog.cpp src/qt/sendmessagesdialog.h \
build/ui_sendmessagesdialog.h \
src/qt/qvalidatedlineedit.h \
src/qt/walletmodel.h \
src/allocators.h \
src/instantx.h \
Expand Down Expand Up @@ -4625,6 +4635,8 @@ build/sendmessagesdialog.o: src/qt/sendmessagesdialog.cpp src/qt/sendmessagesdia

build/sendmessagesentry.o: src/qt/sendmessagesentry.cpp src/qt/sendmessagesentry.h \
build/ui_sendmessagesentry.h \
src/qt/qvalidatedlineedit.h \
src/qt/qvalidatedtextedit.h \
src/qt/guiutil.h \
src/qt/addressbookpage.h \
src/qt/walletmodel.h \
Expand Down
12 changes: 3 additions & 9 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,9 @@ class CMainParams : public CChainParams {

//MineGenesis(genesis);

vSeeds.push_back(CDNSSeedData("109.230.231.216", "109.230.231.216"));
vSeeds.push_back(CDNSSeedData("159.65.28.130", "159.65.28.130"));
vSeeds.push_back(CDNSSeedData("159.65.28.135", "159.65.28.135"));
vSeeds.push_back(CDNSSeedData("188.68.56.33", "188.68.56.33"));
vSeeds.push_back(CDNSSeedData("185.194.142.254", "185.194.142.254"));
vSeeds.push_back(CDNSSeedData("37.120.184.247", "37.120.184.247"));
vSeeds.push_back(CDNSSeedData("zPools.de", "zPools.de"));


vSeeds.push_back(CDNSSeedData("seed1.projectsono.io", "seed1.projectsono.io"));
vSeeds.push_back(CDNSSeedData("seed2.projectsono.io", "seed2.projectsono.io"));
vSeeds.push_back(CDNSSeedData("seed3.projectsono.io", "seed3.projectsono.io"));

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1, 23);
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1, 125);
Expand Down
23 changes: 3 additions & 20 deletions src/checkpoints.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,33 +29,16 @@ namespace Checkpoints
static MapCheckpoints mapCheckpoints =
boost::assign::map_list_of
( 0, uint256("0x00000f14896ba98013ed07e0ecf6e29b360a20898aab5c23238fd08c17ac1b10") )
( 1000, uint256("0x43897b66f9fce27d400d6a90ce57d3f6bf8e05ac0f970eec3aeb7aa9db4ce71f") )
( 2000, uint256("0x825b0ab760d54f351c166feb83011379cc87cb9f7ea2f780e767fff0bb8fbf92") )
( 5000, uint256("0x72c75a83ece934dc22ba08a6b0e25f37a400d13c8856c21431b0be8bf7d22f31") )
( 10000, uint256("0x771e841b1e86729193c14d9bd25eaf9c53ed22a8676d0594a05d90adaee2f52e") )
( 25000, uint256("0xac4c189c34021582003ff38534bc1bd13590bc7b5d550f19078c217941e86261") )
( 35000, uint256("0xad6e983fd49ead6303ae8052d1f1eb3bda5f486d7d3e5b30237db42f86677420") )
( 45000, uint256("0xf301c4fe84c7a50665365816c9c609c6a31a571dc141edc5fc023fbd3174848b") )
( 50000, uint256("0x152921539825e79d237bcb80a69048937dfe10a1ce902c4d390823318630bdaf") )
( 60000, uint256("0xb2848b4c2f26152e300be4d56af9b3624fa73c6985acaae6adaf544706d31de6") )
( 75000, uint256("0x86bd94044445d68e86ccd421265fb8be3bed70507e04237e4116718db6e27437") )
(100000, uint256("0x73004f988252f1ee9336c4a04d83a5f0d221d5f7033274fec283eecb75ac81e9") )
(125000, uint256("0x3d09fcbefac92879ecb904206f932cbccd1741defc5132529cfbeb65256d4d40") )
(150000, uint256("0x4985cf127e052b2bb0346c619ab6dbd8274dbe837537a9fdee92e877f9715807") )
(175000, uint256("0x9f031e1c11ee3c8f7589b82ef49a2819d8f518061fa0d0df41a769fd70dfeccc") )
(190000, uint256("0xb6803f0d76c43a65eafd928769bec63193a0a8a69d6726f6ef39284b656e7100") )
(192000, uint256("0x85d994b4fefbd1c07a48a7d67233c053093c99fcdc0a905e6fdd61069ab2e6a4") )
(192500, uint256("0x5abbb3865f7ebde9375fff23538796e8fd27f6854bdeb934ffd18582e6ecfe41") )
(193000, uint256("0x7249a6b6b43c5e37896d671125d1b4675f4626bc9a2b29f5b3e22ab07f6e7c95") )
(193500, uint256("0xaebf3a45502af59647b6e3ad5e582b6a09239f41cd732dfc2ea33d635f261652") )
(194000, uint256("0xf82a62095f49a49923286c48c9a5566582eb99c1cd8ffe003639677c5d6cfd6b") )
(196000, uint256("0x5079b35197d2c5ea448826475f58236072b7f71cbb23f39f49c31a7ea8bce4df") )
(200000, uint256("0x4dbe5400e6ce489b9841000ae1a88096b1b9bcbbc7013385ccb976ec13e4e2cd") )
(240000, uint256("0xbb6bc6c1851c0607347a5b8e3c3aef75bda86da606cd5815052dba8a08a46cac") )




(225000, uint256("0xabe7bdad25fea3674ec77247ba9e0841105238cd5eafa315b18425d551666ee5") )
(250000, uint256("0xa4cf32e008ee6c64a8d3d07132f94e385c595042462bd7d92e7f6f5b26dc2216") )
(268000, uint256("0x3db9f981b75f1512b5684079dd77345930aadbf282d4e36d86112cb2cb7a5e41") ) //MN Hardfork

;

Expand Down
2 changes: 1 addition & 1 deletion src/clientversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 3
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 1
#define CLIENT_VERSION_BUILD 2

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
Expand Down
Binary file added src/leveldb/.Makefile.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion src/qt/forms/aboutdialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<cursorShape>IBeamCursor</cursorShape>
</property>
<property name="text">
<string notr="true">1.3.0.1</string>
<string notr="true">1.3.0.2</string>
</property>
<property name="textInteractionFlags">
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
Expand Down
56 changes: 7 additions & 49 deletions src/qt/forms/masternodemanager.ui
Original file line number Diff line number Diff line change
Expand Up @@ -87,55 +87,6 @@
</column>
</widget>
</item>
<item row="2" column="0">
<widget class="QTableWidget" name="tableWidget_3">
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="sortingEnabled">
<bool>true</bool>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<column>
<property name="text">
<string>Address</string>
</property>
</column>
<column>
<property name="text">
<string>Rank</string>
</property>
</column>
<column>
<property name="text">
<string>Active</string>
</property>
</column>
<column>
<property name="text">
<string>Active (secs)</string>
</property>
</column>
<column>
<property name="text">
<string>Last Seen</string>
</property>
</column>
<column>
<property name="text">
<string>Pubkey</string>
</property>
</column>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="bottomMargin">
Expand All @@ -155,6 +106,13 @@
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Sorting function is in ALPHA phase</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
Expand Down
14 changes: 9 additions & 5 deletions src/qt/masternodemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ void MasternodeManager::on_tableWidget_2_itemSelectionChanged()
}
}

void MasternodeManager::updateAdrenalineNode(QString alias, QString addr, QString privkey, QString collateral)
void MasternodeManager::updateAdrenalineNode(QString alias, QString addr, QString privkey, QString collateral, QString status)
{
LOCK(cs_adrenaline);
bool bFound = false;
Expand All @@ -117,15 +117,17 @@ void MasternodeManager::updateAdrenalineNode(QString alias, QString addr, QStrin
if(nodeRow == 0 && !bFound)
ui->tableWidget_2->insertRow(0);


QTableWidgetItem *aliasItem = new QTableWidgetItem(alias);
QTableWidgetItem *addrItem = new QTableWidgetItem(addr);
QTableWidgetItem *statusItem = new QTableWidgetItem("");
QTableWidgetItem *statusItem = new QTableWidgetItem(status);
QTableWidgetItem *collateralItem = new QTableWidgetItem(collateral);

ui->tableWidget_2->setItem(nodeRow, 0, aliasItem);
ui->tableWidget_2->setItem(nodeRow, 1, addrItem);
ui->tableWidget_2->setItem(nodeRow, 2, statusItem);
ui->tableWidget_2->setItem(nodeRow, 3, collateralItem);
ui->tableWidget_2->setSortingEnabled(true);
}

static QString seconds_to_DHMS(quint32 duration)
Expand Down Expand Up @@ -179,16 +181,18 @@ void MasternodeManager::updateNodeList()
ui->tableWidget->setItem(mnRow, 3, activeSecondsItem);
ui->tableWidget->setItem(mnRow, 4, lastSeenItem);
ui->tableWidget->setItem(mnRow, 5, pubkeyItem);
ui->tableWidget->setSortingEnabled(true);
ui->countLabel->setText(QString::number(ui->tableWidget->rowCount()));
}

ui->countLabel->setText(QString::number(ui->tableWidget->rowCount()));


if(pwalletMain)
{
LOCK(cs_adrenaline);
BOOST_FOREACH(PAIRTYPE(std::string, CAdrenalineNodeConfig) adrenaline, pwalletMain->mapMyAdrenalineNodes)
{
updateAdrenalineNode(QString::fromStdString(adrenaline.second.sAlias), QString::fromStdString(adrenaline.second.sAddress), QString::fromStdString(adrenaline.second.sMasternodePrivKey), QString::fromStdString(adrenaline.second.sCollateralAddress));
updateAdrenalineNode(QString::fromStdString(adrenaline.second.sAlias), QString::fromStdString(adrenaline.second.sAddress), QString::fromStdString(adrenaline.second.sMasternodePrivKey), QString::fromStdString(adrenaline.second.sCollateralAddress), QString::fromStdString(adrenaline.second.sstatus));
}
}
}
Expand Down Expand Up @@ -284,7 +288,7 @@ void MasternodeManager::on_removeButton_clicked()
ui->tableWidget_2->setRowCount(0);
BOOST_FOREACH(PAIRTYPE(std::string, CAdrenalineNodeConfig) adrenaline, pwalletMain->mapMyAdrenalineNodes)
{
updateAdrenalineNode(QString::fromStdString(adrenaline.second.sAlias), QString::fromStdString(adrenaline.second.sAddress), QString::fromStdString(adrenaline.second.sMasternodePrivKey), QString::fromStdString(adrenaline.second.sCollateralAddress));
updateAdrenalineNode(QString::fromStdString(adrenaline.second.sAlias), QString::fromStdString(adrenaline.second.sAddress), QString::fromStdString(adrenaline.second.sMasternodePrivKey), QString::fromStdString(adrenaline.second.sCollateralAddress), QString::fromStdString(adrenaline.second.sstatus));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/qt/masternodemanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MasternodeManager : public QWidget

public slots:
void updateNodeList();
void updateAdrenalineNode(QString alias, QString addr, QString privkey, QString collateral);
void updateAdrenalineNode(QString alias, QString addr, QString privkey, QString collateral, QString status);

signals:

Expand Down
20 changes: 15 additions & 5 deletions src/rpcdarksend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,23 +273,33 @@ Value masternode(const Array& params, bool fHelp)

if (strCommand == "list")
{
std::string strCommand = "active";
std::string strCommand = "full";

if (params.size() == 2){
strCommand = params[1].get_str().c_str();
}

if (strCommand != "active" && strCommand != "vin" && strCommand != "pubkey" && strCommand != "lastseen" && strCommand != "activeseconds" && strCommand != "rank" && strCommand != "protocol"){
if (strCommand != "full" && strCommand != "vin" && strCommand != "pubkey" && strCommand != "lastseen" && strCommand != "activeseconds" && strCommand != "rank" && strCommand != "protocol"){
throw runtime_error(
"list supports 'active', 'vin', 'pubkey', 'lastseen', 'activeseconds', 'rank', 'protocol'\n");
"list supports: 'full', 'vin', 'pubkey', 'lastseen', 'activeseconds', 'rank', 'protocol'\n");
}

Object obj;
BOOST_FOREACH(CMasterNode mn, vecMasternodes) {
mn.Check();

if(strCommand == "active"){
obj.push_back(Pair(mn.addr.ToString().c_str(), (int)mn.IsEnabled()));
if(strCommand == "full"){
std::ostringstream streamFull;
streamFull << std::setw(18) <<
(int)mn.IsEnabled() << " " << //Is Enabled
(int64_t)mn.lastTimeSeen << " " << //Last time seen
(int64_t)(mn.lastTimeSeen - mn.now) << " " << //Time active (in sec)
(int)(GetMasternodeRank(mn.vin, pindexBest->nHeight)) << " " << //Rank
(int64_t)mn.protocolVersion; //Protocol Version of Masternode

std::string strFull = streamFull.str();
obj.push_back(Pair(mn.addr.ToString().c_str(), strFull)); //Reports "MasternodeIP: Enabled, Last time seen, Time active, Rank, Protocol"

} else if (strCommand == "vin") {
obj.push_back(Pair(mn.addr.ToString().c_str(), mn.vin.prevout.hash.ToString().c_str()));
} else if (strCommand == "pubkey") {
Expand Down
8 changes: 4 additions & 4 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ static const int DATABASE_VERSION = 70510;
// network protocol versioning
//

static const int PROTOCOL_VERSION = 70010;
static const int PROTOCOL_VERSION = 70011;

// intial proto version, to be increased after version/verack negotiation
static const int INIT_PROTO_VERSION = 209;

// disconnect from peers older than this proto version
static const int MIN_PEER_PROTO_VERSION = 70005;
static const int MIN_PEER_PROTO_VERSION = 70010;

static const int MIN_INSTANTX_PROTO_VERSION = 70005;
static const int MIN_INSTANTX_PROTO_VERSION = 70010;

static const int MIN_MN_PROTO_VERSION = 70005;
static const int MIN_MN_PROTO_VERSION = 70010;

// nTime field added to CAddress, starting with this version;
// if possible, avoid requesting addresses nodes older than this
Expand Down
1 change: 1 addition & 0 deletions src/walletdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ class CAdrenalineNodeConfig
std::string sAddress;
std::string sCollateralAddress;
std::string sMasternodePrivKey;
std::string sstatus;

CAdrenalineNodeConfig()
{
Expand Down