Skip to content

Commit

Permalink
Merge pull request #238 from carsenk/v3.4
Browse files Browse the repository at this point in the history
v3.3.9.3
  • Loading branch information
metaspartan authored Sep 18, 2019
2 parents 3f0034b + c600b20 commit fa5dd1f
Show file tree
Hide file tree
Showing 19 changed files with 141 additions and 53 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Tribus Algo PoW/PoS Hybrid Cryptocurrency

[![Snap Status](https://build.snapcraft.io/badge/carsenk/denarius.svg)](https://build.snapcraft.io/user/carsenk/denarius)

![Code Climate](https://codeclimate.com/github/carsenk/denarius/badges/gpa.svg)

[![Build Status](https://travis-ci.org/carsenk/denarius.svg?branch=master)](https://travis-ci.org/carsenk/denarius)

[![Build history](https://buildstats.info/travisci/chart/carsenk/denarius?branch=master)](https://travis-ci.org/carsenk/denarius?branch=master)
Expand All @@ -26,7 +28,7 @@ Denarius is a true optional anonymous, untraceable, and secure hybrid cryptocurr
Ticker: D

Denarius [D] is an anonymous, untraceable, energy efficient, Proof-of-Work (New Tribus Algorithm) and Proof-of-Stake cryptocurrency.
10,000,000 D will be created in approx. about 3 years during the PoW phase. Denarius had a 10% Premine of 1,000,000 D for bounties, distribution, and marketing.
10,000,000 D will be created in approx. about 3 years during the PoW phase.

Specifications
==========================
Expand Down
8 changes: 3 additions & 5 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Denarius - Snapcraft Build - Known to build in most Ubuntu versions - WIP Currently as of Denarius v3.3.8.5
# Denarius - Snapcraft Build - Known to build in most Ubuntu versions - WIP Currently as of Denarius v3.3.9.3
# https://denarius.io
# https://github.com/carsenk/denarius
# By Carsen Klock
name: denarius
version: '3.3.8.5'
version: '3.3.9.3'
summary: Denarius
description: |
An open source hybrid cryptocurrency called Denarius, which features Fortuna Stakes (Masternodes), Staking, Mining, Multisig, and much more!
icon: share/pixmaps/denarius-128.png
grade: devel
confinement: strict

apps:
denarius:
command: Denarius
command: desktop-launch $SNAP/usr/local/bin/denarius
plugs: [home, network, network-bind, unity7]
desktop: denarius.desktop

Expand Down Expand Up @@ -93,4 +92,3 @@ parts:
OPENSSL_INCLUDE_PATH=/usr/local/ssl/include OPENSSL_LIB_PATH=/usr/local/ssl/lib make -j4
sudo cp Denarius /usr/bin/
sudo cp contrib/debian/denarius-qt.desktop $SNAPCRAFT_PART_INSTALL/denarius.desktop
sudo cp share/pixmaps/denarius-128.png $SNAPCRAFT_PART_INSTALL/denarius-128.png
8 changes: 7 additions & 1 deletion src/activefortunastake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,12 @@ bool CActiveFortunastake::GetFortunaStakeVin(CTxIn& vin, CPubKey& pubkey, CKey&

bool CActiveFortunastake::GetFortunaStakeVin(CTxIn& vin, CPubKey& pubkey, CKey& secretKey, std::string strTxHash, std::string strOutputIndex, std::string& errorMessage) {

if (pwalletMain->IsLocked())
{
errorMessage = "Error: Your wallet is locked! Please unlock your wallet!";
return false;
}

// Find possible candidates
vector<COutput> possibleCoins = SelectCoinsFortunastake(false);
COutput *selectedOutput;
Expand Down Expand Up @@ -484,7 +490,7 @@ vector<COutput> CActiveFortunastake::SelectCoinsFortunastake(bool fSelectUnlocke
vector<COutPoint> confLockedCoins;

// Temporary unlock MN coins from fortunastake.conf
if(fSelectUnlocked && GetBoolArg("-mnconflock", true) || fSelectUnlocked && GetBoolArg("-fsconflock", true)) {
if(fSelectUnlocked && GetBoolArg("-fsconflock", true)) {
uint256 mnTxHash;
BOOST_FOREACH(CFortunastakeConfig::CFortunastakeEntry mne, fortunastakeConfig.getEntries()) {
mnTxHash.SetHex(mne.getTxHash());
Expand Down
5 changes: 3 additions & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,6 @@ std::string HelpMessage()
"\n" + _("Fortunastake options:") + "\n" +
" -fortunastake=<n> " + _("Enable the client to act as a fortunastake (0-1, default: 0)") + "\n" +
" -mnconf=<file> " + _("Specify fortunastake configuration file (default: fortunastake.conf)") + "\n" +
" -mnconflock=<n> " + _("Lock fortunastakes from fortunastake configuration file (default: 1)") +
" -fsconflock=<n> " + _("Lock fortunastakes from fortunastake configuration file (default: 1)") +
" -fortunastakeprivkey=<n> " + _("Set the fortunastake private key") + "\n" +
" -fortunastakeaddr=<n> " + _("Set external address:port to get to this fortunastake (example: address:port)") + "\n" +
Expand Down Expand Up @@ -515,6 +514,8 @@ bool AppInit2()
nDerivationMethodIndex = 0;

fTestNet = GetBoolArg("-testnet");

fFSLock = GetBoolArg("-fsconflock");
fNativeTor = GetBoolArg("-nativetor");

//if (fTestNet)
Expand Down Expand Up @@ -1183,7 +1184,7 @@ bool AppInit2()
}

if (pwalletMain) {
if(GetBoolArg("-fsconflock", true) & GetBoolArg("-mnconflock", true)) {
if(GetBoolArg("-fsconflock", true)) {
LOCK(pwalletMain->cs_wallet);
printf("Locking Fortunastakes:\n");
uint256 mnTxHash;
Expand Down
17 changes: 11 additions & 6 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3643,14 +3643,14 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock)
}

// If don't already have its previous block, shunt it off to holding area until we get it
if (pblock->hashPrevBlock != 0 && !mapBlockIndex.count(pblock->hashPrevBlock))
if (!mapBlockIndex.count(pblock->hashPrevBlock)) //pblock->hashPrevBlock != 0 &&
{
if (fDebug)
//printf("ProcessBlock: ORPHAN BLOCK, prev=%s\n", pblock->hashPrevBlock.ToString().substr(0,20).c_str());
LogPrintf("ProcessBlock: ORPHAN BLOCK %lu, prev=%s\n", (unsigned long)mapOrphanBlocks.size(), pblock->hashPrevBlock.ToString());
printf("ProcessBlock: ORPHAN BLOCK, prev=%s\n", pblock->hashPrevBlock.ToString().substr(0,20).c_str());
//LogPrintf("ProcessBlock: ORPHAN BLOCK %lu, prev=%s\n", (unsigned long)mapOrphanBlocks.size(), pblock->hashPrevBlock.ToString());

if (pfrom)
PruneOrphanBlocks();
//if (pfrom)
//PruneOrphanBlocks();

// ppcoin: check proof-of-stake
if (pblock->IsProofOfStake())
Expand Down Expand Up @@ -5239,7 +5239,12 @@ bool SendMessages(CNode* pto, bool fSendTrickle)


// Resend wallet transactions that haven't gotten in a block yet
ResendWalletTransactions();
// Except during reindex, importing and IBD, when old wallet
// transactions become unconfirmed and spams other nodes.
if (!fReindex && !IsInitialBlockDownload())
{
ResendWalletTransactions();
}

// Address refresh broadcast
static int64_t nLastRebroadcast;
Expand Down
4 changes: 2 additions & 2 deletions src/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
static const unsigned int MAX_TX_SIGOPS = MAX_BLOCK_SIGOPS/5;
//static const unsigned int MAX_ORPHAN_TRANSACTIONS = MAX_BLOCK_SIZE/100; deprecated
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 100;
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 10000; //Was 100, lets handle 10k
/** Default for -maxorphanblocks, maximum number of orphan blocks kept in memory */
static const unsigned int DEFAULT_MAX_ORPHAN_BLOCKS = 750;
static const unsigned int DEFAULT_MAX_ORPHAN_BLOCKS = 1000; //Default 750, Lets handle 1000
static const unsigned int MAX_INV_SZ = 50000;
static const int64_t MIN_TX_FEE = 1000;
static const int64_t MIN_TX_FEE_ANON = 10000;
Expand Down
6 changes: 5 additions & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1523,9 +1523,13 @@ void ThreadOnionSeed(void* parg)
static const char *strDNSSeed[][2] = {
{"dnsseed.hashbag.cc", "dnsseed.hashbag.cc"},
{"seed.denarius.host", "seed.denarius.host"},
{"denariusseed.swarmpvp.com", "denariusseed.swarmpvp.com"}
{"dnsseed.denarius.guide", "dnsseed.denarius.guide"},
{"dnsseed.denarius.pro", "dnsseed.denarius.pro"},
{"mseed.denarius.guide", "mseed.denarius.guide"},
{"bseed.denarius.guide", "bseed.denarius.guide"}
};


void ThreadDNSAddressSeed(void* parg)
{
if(!fNativeTor)
Expand Down
1 change: 1 addition & 0 deletions src/qt/bitcoin.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
<file alias="statistics">res/icons/stats.png</file>
<file alias="msg">res/icons/message.png</file>
<file alias="refresh">res/icons/refresh.png</file>
<file alias="fs">res/icons/fs.png</file>
<file alias="data">res/icons/data.png</file>
<file alias="trade">res/icons/trade.png</file>
</qresource>
Expand Down
9 changes: 9 additions & 0 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
proofOfImagePage = new ProofOfImage(this);
//chatWindow = new ChatWindow(this);

fFSLock = GetBoolArg("-fsconflock");
fNativeTor = GetBoolArg("-nativetor");

transactionsPage = new QWidget(this);
QVBoxLayout *vbox = new QVBoxLayout();
Expand Down Expand Up @@ -242,11 +244,15 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
labelConnectionsIcon = new QLabel();
labelBlocksIcon = new QLabel();
labelConnectTypeIcon = new QLabel();
labelFSLockIcon = new QLabel();
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelEncryptionIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelConnectTypeIcon);
frameBlocksLayout->addStretch();
if (fFSLock)
frameBlocksLayout->addWidget(labelFSLockIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelStakingIcon);
frameBlocksLayout->addStretch();
frameBlocksLayout->addWidget(labelConnectionsIcon);
Expand Down Expand Up @@ -807,6 +813,9 @@ void BitcoinGUI::setNumConnections(int count)
labelConnectTypeIcon->setPixmap(QIcon(":/icons/toroff").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
labelConnectTypeIcon->setToolTip(tr("Not Connected via the Tor Network, Start Denarius with the flag nativetor=1"));
}
if (fFSLock == true) {
labelFSLockIcon->setPixmap(QIcon(":/icons/fs").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
}
}

void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
Expand Down
1 change: 1 addition & 0 deletions src/qt/bitcoingui.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ class BitcoinGUI : public QMainWindow
QLabel *labelConnectionsIcon;
QLabel *labelBlocksIcon;
QLabel *labelConnectTypeIcon;
QLabel *labelFSLockIcon;
QLabel *progressBarLabel;
QLabel *mainIcon;
QToolBar *mainToolbar;
Expand Down
5 changes: 5 additions & 0 deletions src/qt/clientmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ bool ClientModel::isNativeTor() const
return fNativeTor;
}

bool ClientModel::isFSLock() const
{
return fFSLock;
}

bool ClientModel::inInitialBlockDownload() const
{
return IsInitialBlockDownload();
Expand Down
3 changes: 3 additions & 0 deletions src/qt/clientmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class ClientModel : public QObject
//! Return true if client connected to Tor
bool isNativeTor() const;

//! Return true if client has locked FS inputs
bool isFSLock() const;

//! Return true if core is doing initial block download
bool inInitialBlockDownload() const;
//! Return conservative estimate of total number of blocks, or 0 if unknown
Expand Down
2 changes: 1 addition & 1 deletion src/qt/forms/rpcconsole.ui
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_info">
<attribute name="title">
Expand Down
73 changes: 57 additions & 16 deletions src/qt/fortunastakemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,22 @@ void FortunastakeManager::setWalletModel(WalletModel *model)

void FortunastakeManager::on_createButton_clicked()
{
if (pwalletMain->IsLocked())
{
QMessageBox msg;
msg.setText("Error: Wallet is locked, unable to create FS.");
msg.exec();
return;
};

if (fWalletUnlockStakingOnly)
{
QMessageBox msg;
msg.setText("Error: Wallet unlocked for staking only, unable to create FS.");
msg.exec();
return;
};

AddEditAdrenalineNode* aenode = new AddEditAdrenalineNode();
aenode->exec();
}
Expand Down Expand Up @@ -518,27 +534,52 @@ void FortunastakeManager::on_getConfigButton_clicked()

void FortunastakeManager::on_startButton_clicked()
{
// start the node
QItemSelectionModel* selectionModel = ui->tableWidget_2->selectionModel();
QModelIndexList selected = selectionModel->selectedRows();
if(selected.count() == 0)
return;
QString results;
WalletModel::UnlockContext ctx(walletModel->requestUnlock());

QModelIndex index = selected.at(0);
int r = index.row();
std::string sAddress = ui->tableWidget_2->item(r, 1)->text().toStdString();
CAdrenalineNodeConfig c = pwalletMain->mapMyAdrenalineNodes[sAddress];
if(!ctx.isValid())
{
results = "Wallet failed to unlock.\n";

std::string errorMessage;
bool result = activeFortunastake.Register(c.sAddress, c.sFortunastakePrivKey, c.sTxHash, c.sOutputIndex, errorMessage);
} else {
// start the node
QItemSelectionModel *selectionModel = ui->tableWidget_2->selectionModel();
QModelIndexList selected = selectionModel->selectedRows();
if (selected.count() == 0)
return;

int successful = 0;
int fail = 0;

QModelIndex index = selected.at(0);
int r = index.row();
std::string sAddress = ui->tableWidget_2->item(r, 1)->text().toStdString();
CAdrenalineNodeConfig c = pwalletMain->mapMyAdrenalineNodes[sAddress];

std::string errorMessage;
bool result = activeFortunastake.Register(c.sAddress, c.sFortunastakePrivKey, c.sTxHash, c.sOutputIndex,
errorMessage);

if (result)
{
results += "Hybrid Fortunastake at " + QString::fromStdString(c.sAddress) + " started.";
successful++;
}
else
{
results += "Error: " + QString::fromStdString(errorMessage);
fail++;
}
}

if(ctx.isValid())
{
pwalletMain->Lock();
}

QMessageBox msg;
msg.setWindowTitle("Denarius Message");
if(result)
msg.setText("Hybrid Fortunastake at " + QString::fromStdString(c.sAddress) + " started.");
else
msg.setText("Error: " + QString::fromStdString(errorMessage));

msg.setText(results);
msg.exec();
}

Expand Down
Binary file added src/qt/res/icons/fs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/rpcwallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Value getinfo(const Array& params, bool fHelp)

obj.push_back(Pair("testnet", fTestNet));
obj.push_back(Pair("fortunastake", fFortunaStake));
obj.push_back(Pair("fslock", fFSLock));
obj.push_back(Pair("nativetor", fNativeTor));
obj.push_back(Pair("keypoololdest", (int64_t)pwalletMain->GetOldestKeyPoolTime()));
obj.push_back(Pair("keypoolsize", (int)pwalletMain->GetKeyPoolSize()));
Expand Down
36 changes: 19 additions & 17 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ bool fCommandLine = false;
string strMiscWarning;
bool fTestNet = false;
bool fNativeTor = false;
bool fFSLock = false;
bool fNoListen = false;
bool fLogTimestamps = false;
CMedianFilter<int64_t> vTimeOffsets(200,0);
Expand Down Expand Up @@ -1179,22 +1180,23 @@ void WriteConfigFile(FILE* configFile)
fputs ("listen=1\n", configFile);
fputs ("server=1\n", configFile);
fputs ("addnode=149.28.51.135\n", configFile); //mining.cafe
fputs ("addnode=144.136.70.136\n", configFile); // Peers need updating after mandatory
fputs ("addnode=24.117.192.101\n", configFile);
fputs ("addnode=24.205.81.255\n", configFile);
fputs ("addnode=45.77.235.152\n", configFile);
fputs ("addnode=81.204.3.6\n", configFile);
fputs ("addnode=173.255.132.121:33369\n", configFile);
fputs ("addnode=185.153.46.15:333691\n", configFile);
fputs ("addnode=217.122.154.194:33369\n", configFile);
fputs ("addnode=222.107.38.86:33369\n", configFile);
fputs ("addnode=45.32.205.128:33369\n", configFile);
fputs ("addnode=45.76.127.137:33369\n", configFile);
fputs ("addnode=51.38.112.208:33369\n", configFile);
fputs ("addnode=67.166.241.130:33369\n", configFile);
fputs ("addnode=70.161.133.63:33369\n", configFile);
fputs ("addnode=82.51.2.218:33369\n", configFile);
fputs ("addnode=94.64.12.74:33369\n", configFile);
fputs ("addnode=144.136.70.136\n", configFile);
fputs ("addnode=104.238.179.184\n", configFile);
fputs ("addnode=116.203.60.24\n", configFile);
fputs ("addnode=134.3.128.167\n", configFile);
fputs ("addnode=140.82.60.123\n", configFile);
fputs ("addnode=51.38.112.208\n", configFile);
fputs ("addnode=144.202.108.83:33369\n", configFile);
fputs ("addnode=89.142.75.60:333691\n", configFile);
fputs ("addnode=77.165.171.219:33369\n", configFile);
fputs ("addnode=54.39.98.175:33369\n", configFile);
fputs ("addnode=51.83.83.216:33369\n", configFile);
fputs ("addnode=45.77.59.115:33369\n", configFile);
fputs ("addnode=31.220.42.242:33369\n", configFile);
fputs ("addnode=24.205.81.255:33369\n", configFile);
fputs ("addnode=207.189.31.106:33369\n", configFile);
fputs ("addnode=207.148.86.124:33369\n", configFile);
fputs ("addnode=207.180.213.175:33369\n", configFile);
fclose(configFile);
ReadConfigFile(mapArgs, mapMultiArgs);
}
Expand Down Expand Up @@ -1243,7 +1245,7 @@ boost::filesystem::path GetConfigFile()

boost::filesystem::path GetFortunastakeConfigFile()
{
boost::filesystem::path pathConfigFile(GetArg("-mnconf", "fortunastake.conf"));
boost::filesystem::path pathConfigFile(GetArg("-fsconf", "fortunastake.conf"));
if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile;
return pathConfigFile;
}
Expand Down
Loading

0 comments on commit fa5dd1f

Please sign in to comment.