Skip to content
Permalink
Browse files

Merge branch 'dev'

  • Loading branch information...
SkaZun committed Mar 25, 2019
2 parents 39b20cf + f5ecfa8 commit 95d93f5d6bab4ad7f7703562a2f2c5b93cfbb4e7
Showing with 3,970 additions and 1,211 deletions.
  1. +3 −3 configure.ac
  2. +12 −2 src/Makefile.qt.include
  3. +2 −2 src/activemasternode.cpp
  4. +8 −4 src/amount.cpp
  5. +7 −6 src/chainparams.cpp
  6. +4 −0 src/chainparams.h
  7. +3 −3 src/clientversion.h
  8. +27 −12 src/gm.cpp
  9. +4 −6 src/gm.h
  10. +1 −0 src/init.cpp
  11. +12 −4 src/kernel.cpp
  12. +38 −23 src/main.cpp
  13. +4 −4 src/main.h
  14. +174 −24 src/masternode-payments.cpp
  15. +4 −4 src/masternode-sync.cpp
  16. +1 −1 src/masternode.cpp
  17. +2 −0 src/masternode.h
  18. +6 −3 src/masternodeman.cpp
  19. +105 −89 src/miner.cpp
  20. +2 −1 src/obfuscation.cpp
  21. +14 −5 src/pow.cpp
  22. +1 −1 src/primitives/block.h
  23. +2 −2 src/qt/bitcoingui.cpp
  24. +10 −4 src/qt/clientmodel.cpp
  25. +1 −1 src/qt/coincontroldialog.cpp
  26. +114 −1 src/qt/esbcoin.qrc
  27. +909 −878 src/qt/forms/overviewpage.ui
  28. +1 −1 src/qt/forms/toolspage.ui
  29. +9 −5 src/qt/guiutil.cpp
  30. +3 −1 src/qt/optionsdialog.cpp
  31. +31 −20 src/qt/overviewpage.cpp
  32. +2 −0 src/qt/overviewpage.h
  33. +16 −15 src/qt/res/{dark → }/css/dark.css
  34. +2,308 −0 src/qt/res/css/dblue.css
  35. +19 −31 src/qt/res/css/default.css
  36. BIN src/qt/res/dark/icons/icon_medium.png
  37. BIN src/qt/res/dark/icons/icon_reddit.png
  38. BIN src/qt/res/dark/images/frame_blue_old.png
  39. BIN src/qt/res/dblue/icons/add.png
  40. BIN src/qt/res/dblue/icons/address-book.png
  41. BIN src/qt/res/dblue/icons/bittrex.png
  42. BIN src/qt/res/dblue/icons/blockexplorer.png
  43. BIN src/qt/res/dblue/icons/browse.png
  44. BIN src/qt/res/dblue/icons/clock1.png
  45. BIN src/qt/res/dblue/icons/clock2.png
  46. BIN src/qt/res/dblue/icons/clock3.png
  47. BIN src/qt/res/dblue/icons/clock4.png
  48. BIN src/qt/res/dblue/icons/clock5.png
  49. BIN src/qt/res/dblue/icons/configure.png
  50. BIN src/qt/res/dblue/icons/connect0_16.png
  51. BIN src/qt/res/dblue/icons/connect1_16.png
  52. BIN src/qt/res/dblue/icons/connect2_16.png
  53. BIN src/qt/res/dblue/icons/connect3_16.png
  54. BIN src/qt/res/dblue/icons/connect4_16.png
  55. BIN src/qt/res/dblue/icons/debugwindow.png
  56. BIN src/qt/res/dblue/icons/edit.png
  57. BIN src/qt/res/dblue/icons/editcopy.png
  58. BIN src/qt/res/dblue/icons/editpaste.png
  59. BIN src/qt/res/dblue/icons/esbc.png
  60. BIN src/qt/res/dblue/icons/esbcoin.ico
  61. BIN src/qt/res/dblue/icons/esbcoin.png
  62. BIN src/qt/res/dblue/icons/explorer.png
  63. BIN src/qt/res/dblue/icons/export.png
  64. BIN src/qt/res/dblue/icons/eye.png
  65. BIN src/qt/res/dblue/icons/eye_minus.png
  66. BIN src/qt/res/dblue/icons/eye_plus.png
  67. BIN src/qt/res/dblue/icons/filesave.png
  68. BIN src/qt/res/dblue/icons/history.png
  69. BIN src/qt/res/dblue/icons/icon_discord.png
  70. BIN src/qt/res/dblue/icons/icon_explorer.png
  71. BIN src/qt/res/dblue/icons/icon_facebook.png
  72. BIN src/qt/res/dblue/icons/icon_medium.png
  73. BIN src/qt/res/dblue/icons/icon_reddit.png
  74. BIN src/qt/res/dblue/icons/icon_telegram.png
  75. BIN src/qt/res/dblue/icons/icon_twitter.png
  76. BIN src/qt/res/dblue/icons/icon_www.png
  77. BIN src/qt/res/dblue/icons/import.png
  78. BIN src/qt/res/dblue/icons/key.png
  79. BIN src/qt/res/dblue/icons/lock_closed.png
  80. BIN src/qt/res/dblue/icons/lock_open.png
  81. BIN src/qt/res/dblue/icons/masternodes.png
  82. BIN src/qt/res/dblue/icons/overview.png
  83. BIN src/qt/res/dblue/icons/qrcode.png
  84. BIN src/qt/res/dblue/icons/quit.png
  85. BIN src/qt/res/dblue/icons/receive.png
  86. BIN src/qt/res/dblue/icons/remove.png
  87. BIN src/qt/res/dblue/icons/send.png
  88. BIN src/qt/res/dblue/icons/staking_active.png
  89. BIN src/qt/res/dblue/icons/staking_inactive.png
  90. BIN src/qt/res/dblue/icons/synced.png
  91. BIN src/qt/res/dblue/icons/tools.png
  92. BIN src/qt/res/dblue/icons/trade.png
  93. BIN src/qt/res/dblue/icons/transaction0.png
  94. BIN src/qt/res/dblue/icons/transaction2.png
  95. BIN src/qt/res/dblue/icons/transaction_conflicted.png
  96. BIN src/qt/res/dblue/icons/tx_inout.png
  97. BIN src/qt/res/dblue/icons/tx_input.png
  98. BIN src/qt/res/dblue/icons/tx_mined.png
  99. BIN src/qt/res/dblue/icons/tx_output.png
  100. BIN src/qt/res/dblue/images/about.png
  101. BIN src/qt/res/dblue/images/branch-closed.png
  102. BIN src/qt/res/dblue/images/branch-open.png
  103. BIN src/qt/res/dblue/images/downArrow.png
  104. BIN src/qt/res/dblue/images/downArrow_small.png
  105. BIN src/qt/res/dblue/images/frame_blue.png
  106. BIN src/qt/res/dblue/images/leftArrow_small.png
  107. BIN src/qt/res/dblue/images/qtreeview_selected.png
  108. BIN src/qt/res/dblue/images/rightArrow_small.png
  109. BIN src/qt/res/dblue/images/splash.png
  110. BIN src/qt/res/dblue/images/upArrow_small.png
  111. BIN src/qt/res/icons/icon_medium.png
  112. BIN src/qt/res/icons/icon_reddit.png
  113. +1 −1 src/rpcmasternode.cpp
  114. +22 −22 src/rpcserver.cpp
  115. +1 −1 src/rpcwallet.cpp
  116. +25 −5 src/spork.cpp
  117. +8 −3 src/spork.h
  118. +10 −3 src/swifttx.cpp
  119. +1 −0 src/swifttx.h
  120. +6 −4 src/version.h
  121. +35 −14 src/wallet.cpp
  122. +2 −2 src/wallet.h
@@ -1,9 +1,9 @@
dnl require autoconf 2.60 (AS_ECHO/AS_ECHO_N)
AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 2)
define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 4)
define(_CLIENT_VERSION_BUILD, 14)
define(_CLIENT_VERSION_MINOR, 1)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2019)
AC_INIT([ESBC Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[http://esbproject.online/],[esbcoin])
@@ -377,12 +377,22 @@ RES_IMAGES = \
qt/res/dark/images/upArrow_small.png \
qt/res/dark/images/leftArrow_small.png \
qt/res/dark/images/rightArrow_small.png \
qt/res/dark/images/qtreeview_selected.png
qt/res/dark/images/qtreeview_selected.png\
qt/res/dblue/images/about.png \
qt/res/dblue/images/splash.png \
qt/res/dblue/images/frame_blue.png \
qt/res/dblue/images/downArrow.png \
qt/res/dblue/images/downArrow_small.png \
qt/res/dblue/images/upArrow_small.png \
qt/res/dblue/images/leftArrow_small.png \
qt/res/dblue/images/rightArrow_small.png \
qt/res/dblue/images/qtreeview_selected.png


RES_CSS = \
qt/res/css/default.css \
qt/res/dark/css/dark.css
qt/res/css/dblue.css \
qt/res/css/dark.css

RES_MOVIES = $(wildcard $(srcdir)/qt/res/movies/spinner-*.png) \
$(wildcard $(srcdir)/qt/res/dark/movies/spinner-*.png)
@@ -38,7 +38,7 @@ void CActiveMasternode::ManageStatus()
pmn = mnodeman.Find(pubKeyMasternode);
if (pmn != NULL) {
pmn->Check();
if (pmn->IsEnabled() && pmn->protocolVersion == PROTOCOL_VERSION)
if (pmn->IsEnabled() && pmn->protocolVersion >= ActiveProtocol())
EnableHotColdMasterNode(pmn->vin, pmn->addr);
}
}
@@ -176,7 +176,7 @@ bool CActiveMasternode::SendMasternodePing(std::string& errorMessage)
// Update lastPing for our masternode in Masternode list
CMasternode* pmn = mnodeman.Find(vin);
if (pmn != NULL) {
if (pmn->IsPingedWithin(MASTERNODE_PING_SECONDS, mnp.sigTime)) {
if (pmn->IsPingedWithin((ActiveProtocol() >= CONSENSUS_FORK_PROTO) ? MASTERNODE_PING_SECONDS2 : MASTERNODE_PING_SECONDS, mnp.sigTime)) {
errorMessage = "Too early to send Masternode Ping";
return false;
}
@@ -4,7 +4,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#include "amount.h"

#include "spork.h"
#include "tinyformat.h"

CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize)
@@ -17,10 +17,14 @@ CFeeRate::CFeeRate(const CAmount& nFeePaid, size_t nSize)

CAmount CFeeRate::GetFee(size_t nSize) const
{
CAmount nFee = nSatoshisPerK * nSize / 1000;
CAmount nFeePerK = nSatoshisPerK;
if (ActiveProtocol() >= CONSENSUS_FORK_PROTO && nFeePerK == 10000)
nFeePerK = 250000;

CAmount nFee = nFeePerK * nSize / 1000;

if (nFee == 0 && nSatoshisPerK > 0)
nFee = nSatoshisPerK;
if (nFee == 0 && nFeePerK > 0)
nFee = nFeePerK;

return nFee;
}
@@ -148,11 +148,7 @@ class CMainParams : public CChainParams
vSeeds.push_back(CDNSSeedData("", "144.202.22.6"));
vSeeds.push_back(CDNSSeedData("", "144.202.16.146"));
vSeeds.push_back(CDNSSeedData("", "144.202.30.41"));
// vSeeds.push_back(CDNSSeedData("", "188.225.77.175"));
// vSeeds.push_back(CDNSSeedData("", "188.225.77.88"));
// vSeeds.push_back(CDNSSeedData("", "188.225.77.84"));
// vSeeds.push_back(CDNSSeedData("", "188.225.77.83"));
// vSeeds.push_back(CDNSSeedData("", "188.225.77.82"));
vSeeds.push_back(CDNSSeedData("", "79.143.187.24"));

base58Prefixes[PUBKEY_ADDRESS] = std::vector<unsigned char>(1, 92); // e
base58Prefixes[SCRIPT_ADDRESS] = std::vector<unsigned char>(1, 63); // S
@@ -175,6 +171,9 @@ class CMainParams : public CChainParams

nPoolMaxTransactions = 3;

nStakeInputMin = 10 * COIN;
strDevFeeAddress = "eDevFundRTnKngZ3zFPPaqaTuvKvGVdStf";

vAlertPubKey = ParseHex("0428e89226dd86459df40d436a067c83749c78d653e22c556ae2d9b322296f3f1604e2f4789128386bc4acd6184c9a0062cf0cb98cf71cdbca1e808c25b7670367");
vGMPubKey = ParseHex("049e20bd6cc0da7270bfa60daf381593377418ce9270b7dd38a93026acae98966e89da65067b41e388e194a7e4e2276336b3ddba5e3d5bbc81a78a04f982dfb4fc");
strSporkKey = "0416726a44c09752eddf582f08ad668bd49d563322a6ad746347eb6874bbfce2a6ce12c0f991fed88289d977395e1814a0cc1778f24ee2eeaa68d58183f3bd6195";
@@ -213,7 +212,7 @@ class CTestNetParams : public CMainParams
nToCheckBlockUpgradeMajority = 100;
nMinerThreads = 0;
nTargetSpacing = 1 * 60; // 1 minute
nLastPOWBlock = std::numeric_limits<decltype(nLastPOWBlock)>::max();
// nLastPOWBlock = std::numeric_limits<decltype(nLastPOWBlock)>::max();
nMaturity = 15;
nMasternodeCountDrift = 4;
nModifierUpdateBlock = std::numeric_limits<decltype(nModifierUpdateBlock)>::max();
@@ -247,6 +246,8 @@ class CTestNetParams : public CMainParams
fTestnetToBeDeprecatedFieldRPC = true;

nPoolMaxTransactions = 2;
nStakeInputMin = 1 * COIN;
strDevFeeAddress = "xJETLzAQWJj18aQ74cHqAtdStrZves2U4A";

vAlertPubKey = ParseHex("04e2a902b30e8e5430e4f3d1ac79630282cc65a036d0aa70ec041d8903b9a626b601a888d8479412bcc363250b02cb2f0e783e7dbeef8606a6ab635fde952949f9");
vGMPubKey = ParseHex("0414b78fd29848ca55bacabe49c6bf53c8cb5224cdd84590f21616457c564b01d2c26c69fea8a55b5e336cb40981ba3167b04ddd149a21f59ab07cf30a4b7285b1");
@@ -111,6 +111,8 @@ class CChainParams
int LAST_POW_BLOCK() const { return nLastPOWBlock; }
int StartMNPaymentsBlock() const {return nStartMasternodePaymentsBlock; }

std::string DevFeeAddress() const { return strDevFeeAddress; }
CAmount StakeInputMin() const { return nStakeInputMin; }

protected:
CChainParams() {}
@@ -160,6 +162,8 @@ class CChainParams
std::string strSporkKey;
std::string strObfuscationPoolDummyAddress;
int64_t nStartMasternodePayments;
std::string strDevFeeAddress;
CAmount nStakeInputMin;
};

/**
@@ -15,9 +15,9 @@

//! These need to be macros, as clientversion.cpp's and esbcoin*-res.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 2
#define CLIENT_VERSION_MINOR 0
#define CLIENT_VERSION_REVISION 4
#define CLIENT_VERSION_BUILD 14
#define CLIENT_VERSION_MINOR 1
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 1

//! Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE true
@@ -34,12 +34,13 @@ std::map<int, std::pair<CPubKey, int>> mapGMSigners;

void ProcessGM(CNode* pfrom, std::string& strCommand, CDataStream& vRecv)
{
if (chainActive.Tip() == NULL)
return;

if (strCommand == "gm") {
CGM message;
vRecv >> message;

if (chainActive.Tip() == NULL) return;

uint256 messageHash = message.GetHash();
if (pfrom->setKnown.count(messageHash) == 0) {
if (message.ProcessMessage()) {
@@ -61,15 +62,31 @@ void ProcessGM(CNode* pfrom, std::string& strCommand, CDataStream& vRecv)
}
}
}

if (strCommand == "getgm") {
else if (strCommand == "getgm") {
{
LOCK(cs_mapGMs);

CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
for (auto& item : mapGMs)
ss << item.second;
pfrom->PushMessage("gmsync", ss);
/*
map<uint256, CGM>::iterator it = mapGMs.begin();
while (it != mapGMs.end()) {
pfrom->PushMessage("gm", it->second);
it++;
}
*/
}
}
else if (strCommand == "gmsync") {
CGM message;
while (!vRecv.empty()) {
//message.SetNull();
vRecv >> message;
uint256 messageHash = message.GetHash();
if (pfrom->setKnown.count(messageHash) == 0 && message.ProcessMessage())
pfrom->setKnown.insert(messageHash);
}
}
}
@@ -132,7 +149,7 @@ uint256 CGM::GetHash() const

bool CGM::IsInEffect() const
{
return (GetAdjustedTime() < nExpiration);
return (GetTime() < nExpiration);
}

bool CGM::Cancels(const CGM& message) const
@@ -185,13 +202,11 @@ bool CGM::CheckSignature(int& sLevel) const
return error("CGM::CheckSignature() : verify GM signature failed");
} else {
std::map<int, std::pair<CPubKey, int>>::iterator it = mapGMSigners.find(nSignerID);
if (it == mapGMSigners.end()) {
if (it == mapGMSigners.end())
return error("CGM::CheckSignature() : signer not found");
} else {
if (!it->second.first.Verify(Hash(vchMsg.begin(), vchMsg.end()), vchSig))
return error("CGM::CheckSignature() : verify signature failed");
sLevel = !it->second.second;
}
if (!it->second.first.Verify(Hash(vchMsg.begin(), vchMsg.end()), vchSig))
return error("CGM::CheckSignature() : verify signature failed");
sLevel = it->second.second;
}

return true;
@@ -243,7 +258,7 @@ bool CGM::ProcessMessage(bool fThread)

// check transfer message age
if (sLevel == 1) {
if ( (GetAdjustedTime() + 60) < nExpiration ) {
if ( (GetTime() + 60) < nExpiration ) {
LogPrint("gm", "too long active time requested\n");
return false;
}
@@ -1,13 +1,11 @@
// Copyright (c) 2010 Satoshi Nakamoto
// Copyright (c) 2009-2013 The Bitcoin developers
// Copyright (c) 2018 e-Sport Betting Coin developers
// Copyright (c) 2018-2019 The ESBC Core developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

//#ifndef BITCOIN_ALERT_H
//#define BITCOIN_ALERT_H
#ifndef ESPB_GM_H
#define ESPB_GM_H
#ifndef ESBC_GM_H
#define ESBC_GM_H

#include "base58.h"
#include "key.h"
@@ -112,4 +110,4 @@ class CGM : public CUnsignedMessage
static CGM getMessageByHash(const uint256& hash);
};

#endif // ESPB_GM_H // BITCOIN_ALERT_H
#endif // ESBC_GM_H
@@ -1609,6 +1609,7 @@ bool AppInit2(boost::thread_group& threadGroup)
threadGroup.create_thread(boost::bind(&ThreadCheckObfuScationPool));

// ********************************************************* Step 11: start node
InitTxFilter();

if (!CheckDiskSpace())
return false;
@@ -10,6 +10,7 @@

#include "db.h"
#include "kernel.h"
#include "spork.h"
#include "script/interpreter.h"
#include "timedata.h"
#include "util.h"
@@ -243,7 +244,7 @@ bool ComputeNextStakeModifier(const CBlockIndex* pindexPrev, uint64_t& nStakeMod

// The stake modifier used to hash for a stake kernel is chosen as the stake
// modifier about a selection interval later than the coin generating the kernel
bool GetKernelStakeModifier(uint256 hashBlockFrom, uint64_t& nStakeModifier, int& nStakeModifierHeight, int64_t& nStakeModifierTime, bool fPrintProofOfStake)
bool GetKernelStakeModifier(uint256 hashBlockFrom, uint64_t& nStakeModifier, int& nStakeModifierHeight, int64_t& nStakeModifierTime, bool fPrintProofOfStake, int64_t nTime)
{
nStakeModifier = 0;
if (!mapBlockIndex.count(hashBlockFrom))
@@ -252,6 +253,8 @@ bool GetKernelStakeModifier(uint256 hashBlockFrom, uint64_t& nStakeModifier, int
nStakeModifierHeight = pindexFrom->nHeight;
nStakeModifierTime = pindexFrom->GetBlockTime();
int64_t nStakeModifierSelectionInterval = GetStakeModifierSelectionInterval();
if (ActiveProtocol() >= CONSENSUS_FORK_PROTO && nTime >= GetSporkValue(SPORK_10_NEW_PROTOCOL_ENFORCEMENT_2))
nStakeModifierSelectionInterval = nStakeMinAge * 3 / 4;
const CBlockIndex* pindex = pindexFrom;
CBlockIndex* pindexNext = chainActive[pindexFrom->nHeight + 1];

@@ -302,7 +305,7 @@ bool CheckStakeKernelHash(unsigned int nBits, const CBlock blockFrom, const CTra
return error("CheckStakeKernelHash() : nTime violation");

if (nTimeBlockFrom + nStakeMinAge > nTimeTx) // Min age requirement
return error("CheckStakeKernelHash() : min age violation - nTimeBlockFrom=%d nStakeMinAge=%d nTimeTx=%d", nTimeBlockFrom, nStakeMinAge, nTimeTx);
return false; //error("CheckStakeKernelHash() : min age violation - nTimeBlockFrom=%d nStakeMinAge=%d nTimeTx=%d", nTimeBlockFrom, nStakeMinAge, nTimeTx);

//grab difficulty
uint256 bnTargetPerCoinDay;
@@ -312,7 +315,7 @@ bool CheckStakeKernelHash(unsigned int nBits, const CBlock blockFrom, const CTra
uint64_t nStakeModifier = 0;
int nStakeModifierHeight = 0;
int64_t nStakeModifierTime = 0;
if (!GetKernelStakeModifier(blockFrom.GetHash(), nStakeModifier, nStakeModifierHeight, nStakeModifierTime, fPrintProofOfStake)) {
if (!GetKernelStakeModifier(blockFrom.GetHash(), nStakeModifier, nStakeModifierHeight, nStakeModifierTime, fPrintProofOfStake, nTimeTx)) {
LogPrintf("CheckStakeKernelHash(): failed to get kernel stake modifier \n");
return false;
}
@@ -400,8 +403,13 @@ bool CheckProofOfStake(const CBlock block, uint256& hashProofOfStake)
if (!ReadBlockFromDisk(blockprev, pindex->GetBlockPos()))
return error("CheckProofOfStake(): INFO: failed to find block");

unsigned int nInterval = 0;
unsigned int nTime = block.nTime;
if (ActiveProtocol() >= CONSENSUS_FORK_PROTO &&
nTime >= GetSporkValue(SPORK_10_NEW_PROTOCOL_ENFORCEMENT_2) &&
txPrev.vout[txin.prevout.n].nValue < Params().StakeInputMin())
return error("CheckProofOfStake(): stake input below minimal value");

unsigned int nInterval = 0;
if (!CheckStakeKernelHash(block.nBits, blockprev, txPrev, txin.prevout, nTime, nInterval, true, hashProofOfStake, fDebug))
return error("CheckProofOfStake() : INFO: check kernel failed on coinstake %s, hashProof=%s \n", tx.GetHash().ToString().c_str(), hashProofOfStake.ToString().c_str()); // may occur during initial download or if behind on block chain sync

0 comments on commit 95d93f5

Please sign in to comment.
You can’t perform that action at this time.