Commit e7ecfb8e authored by Ashot's avatar Ashot

Merge master to Current-dev

parents 8d8e5ff9 bdaefb53
Pipeline #817 passed with stage
in 82 minutes and 15 seconds
variables:
RELEASE_VERSION: "0.12.5.1"
RELEASE_VERSION: "0.12.5.2"
GIT_STRATEGY: "clone"
MAKEJOBS: "-j4"
CCACHE_SIZE: "100M"
......
......@@ -18,7 +18,9 @@
### Relevant logs, dumps and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code; it's very hard to read otherwise.) Drop full logs & dumps here: https://nextcloud.crown.tech/nextcloud/s/n9wDQqdLXHkCMEx.
logs, and code; it's very hard to read otherwise.)
Drop full logs & dumps here: https://nextcloud.crown.tech/nextcloud/s/znd8HiiAsRX3C6B
### Possible fixes
(Any comments on what you think might be responsible for the problem, if you have particular insight.)
......
......@@ -3,7 +3,7 @@ AC_PREREQ([2.60])
define(_CLIENT_VERSION_MAJOR, 0)
define(_CLIENT_VERSION_MINOR, 12)
define(_CLIENT_VERSION_REVISION, 5)
define(_CLIENT_VERSION_BUILD, 1)
define(_CLIENT_VERSION_BUILD, 2)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_COPYRIGHT_YEAR, 2018)
AC_INIT([Crown Core],[_CLIENT_VERSION_MAJOR._CLIENT_VERSION_MINOR._CLIENT_VERSION_REVISION],[info@crown.tech],[crown])
......
......@@ -7,7 +7,7 @@
#
# Setup crown server or update existing one
LATEST_RELEASE="v0.12.5.1"
LATEST_RELEASE="0.12.5.2"
systemnode=false
masternode=false
......@@ -146,7 +146,7 @@ download_package() {
BITS=64
fi
# Change this later to take latest release version.
wget "https://github.com/Crowndev/crowncoin/releases/download/$LATEST_RELEASE/Crown-Linux$BITS.zip" -O $dir/crown.zip
wget "https://github.com/Crowndev/crowncoin/releases/download/v$LATEST_RELEASE/Crown-$LATEST_RELEASE-Linux64.zip" -O $dir/crown.zip
}
install_package() {
......
......@@ -329,6 +329,7 @@ public:
nEnforceBlockUpgradeMajority = 51;
nRejectBlockOutdatedMajority = 75;
nToCheckBlockUpgradeMajority = 100;
nSubsidyHalvingInterval = 130000;
nMinerThreads = 0;
nTargetTimespan = 2 * 24 * 60 * 60; // 2 days
nTargetSpacing = 1.5 * 60; // 1.5 minutes
......
......@@ -17,7 +17,7 @@
#define CLIENT_VERSION_MAJOR 0
#define CLIENT_VERSION_MINOR 12
#define CLIENT_VERSION_REVISION 5
#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 false
......
......@@ -121,7 +121,7 @@ void InstantSend::ProcessMessage(CNode* pfrom, const std::string& strCommand, CD
CInv inv(MSG_TXLOCK_VOTE, ctx.GetHash());
pfrom->AddInventoryKnown(inv);
if (m_txLockVote.find(ctx.GetHash()) == m_txLockVote.end())
if (m_txLockVote.find(ctx.GetHash()) != m_txLockVote.end())
return;
// Check if transaction is old for lock
......
......@@ -1634,7 +1634,7 @@ double ConvertBitsToDouble(unsigned int nBits)
int64_t GetBlockValue(int nHeight, const CAmount &nFees)
{
int64_t nSubsidy = 10 * COIN;
int64_t nSubsidy = 12 * COIN;
int halvings = nHeight / Params().SubsidyHalvingInterval();
// Force block reward to zero when right shift is undefined.
......@@ -1650,10 +1650,15 @@ int64_t GetBlockValue(int nHeight, const CAmount &nFees)
return 1000000 * COIN;
}
if(Params().NetworkID() == CBaseChainParams::TESTNET){
if(nHeight > 20000) nSubsidy -= nSubsidy/10;
} else {
if(nHeight > 1265000) nSubsidy -= nSubsidy/10;
if (Params().NetworkID() == CBaseChainParams::TESTNET)
{
if (nHeight > 20000)
nSubsidy -= nSubsidy * 0.25; // budget payment is 25%
}
else
{
if (nHeight > 1265000)
nSubsidy -= nSubsidy * 0.25; // budget payment is 25%
}
return nSubsidy + nFees;
......@@ -4320,7 +4325,7 @@ void static ProcessGetData(CNode* pfrom)
}
}
if (!pushed && inv.type == MSG_BUDGET_VOTE) {
const BudgetDraftVote* item = budget.GetSeenBudgetDraftVote(inv.hash);
const CBudgetVote* item = budget.GetSeenVote(inv.hash);
if(item){
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000);
......@@ -4331,7 +4336,7 @@ void static ProcessGetData(CNode* pfrom)
}
if (!pushed && inv.type == MSG_BUDGET_PROPOSAL) {
const CBudgetProposal* item = budget.GetSeenProposal(inv.hash);
const CBudgetProposalBroadcast* item = budget.GetSeenProposal(inv.hash);
if(item){
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000);
......@@ -4357,7 +4362,7 @@ void static ProcessGetData(CNode* pfrom)
if(item){
CDataStream ss(SER_NETWORK, PROTOCOL_VERSION);
ss.reserve(1000);
ss << item->Budget();
ss << *item;
pfrom->PushMessage("fbs", ss);
pushed = true;
}
......@@ -5375,6 +5380,7 @@ bool ProcessMessages(CNode* pfrom)
}
else
{
LogPrintf("ProcessMessages(%s, %u bytes): Exception '%s' caught, see below\n", SanitizeString(strCommand), nMessageSize, e.what());
PrintExceptionContinue(&e, "ProcessMessages()");
}
}
......
......@@ -466,7 +466,6 @@ void CBudgetManager::FillBlockPayee(CMutableTransaction& txNew, CAmount nFees) c
{
LogPrintf("CBudgetManager::FillBlockPayee - Budget payment to %s for %lld; proposal %s\n",
ScriptToAddress(payment.payee).ToString(), payment.nAmount, payment.nProposalHash.ToString());
txNew.vout.push_back(CTxOut(payment.nAmount, payment.payee));
}
}
......@@ -710,17 +709,18 @@ CAmount CBudgetManager::GetTotalBudget(int nHeight)
if(chainActive.Tip() == NULL) return 0;
//get min block value and calculate from that
CAmount nSubsidy = 10 * COIN;
CAmount nSubsidy = 12 * COIN;
int halvings = nHeight / Params().SubsidyHalvingInterval();
// Subsidy is cut in half every 2,100,000 blocks which will occur approximately every 4 years.
nSubsidy >>= halvings;
// Amount of blocks in a months period of time (using 1 minutes per) = (60*24*30)/1
if(Params().NetworkID() == CBaseChainParams::MAIN) return ((nSubsidy/100)*10)*1440*30;
if(Params().NetworkID() == CBaseChainParams::MAIN)
return ((nSubsidy / 100) * 25) * 1440 * 30;
//for testing purposes
return ((nSubsidy/100)*10)*50;
return ((nSubsidy / 100) * 25) * 50;
}
void CBudgetManager::NewBlock()
......@@ -1188,7 +1188,7 @@ const BudgetDraftVote* CBudgetManager::GetSeenBudgetDraftVote(uint256 hash) cons
return &found->second;
}
const CBudgetProposal* CBudgetManager::GetSeenProposal(uint256 hash) const
const CBudgetProposalBroadcast* CBudgetManager::GetSeenProposal(uint256 hash) const
{
LOCK(cs);
......
......@@ -179,7 +179,7 @@ public:
const BudgetDraftBroadcast* GetSeenBudgetDraft(uint256 hash) const;
const BudgetDraftVote* GetSeenBudgetDraftVote(uint256 hash) const;
const CBudgetProposal* GetSeenProposal(uint256 hash) const;
const CBudgetProposalBroadcast* GetSeenProposal(uint256 hash) const;
const CBudgetVote* GetSeenVote(uint256 hash) const;
bool AddProposal(const CBudgetProposal &budgetProposal, bool checkCollateral = true);
......
......@@ -17,6 +17,8 @@
#include "timedata.h"
#include "util.h"
#include "utilmoneystr.h"
#include "spork.h"
#include "masternode-budget.h"
#ifdef ENABLE_WALLET
#include "wallet.h"
#endif
......@@ -329,13 +331,18 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
FillBlockPayee(txNew, nFees);
SNFillBlockPayee(txNew, nFees);
// Make payee
if(txNew.vout.size() > 1){
pblock->payee = txNew.vout[1].scriptPubKey;
}
// Make SNpayee
if(txNew.vout.size() > 2){
pblock->payeeSN = txNew.vout[2].scriptPubKey;
if (!(IsSporkActive(SPORK_13_ENABLE_SUPERBLOCKS) && budget.IsBudgetPaymentBlock(pindexPrev->nHeight + 1)))
{
// Make payee
if(txNew.vout.size() > 1)
{
pblock->payee = txNew.vout[1].scriptPubKey;
}
// Make SNpayee
if(txNew.vout.size() > 2)
{
pblock->payeeSN = txNew.vout[2].scriptPubKey;
}
}
nLastBlockTx = nBlockTx;
......
......@@ -18,6 +18,8 @@
#include "rpcserver.h"
#include "util.h"
#include "auxpow.h"
#include "spork.h"
#include "masternode-budget.h"
#ifdef ENABLE_WALLET
#include "db.h"
#include "wallet.h"
......@@ -412,6 +414,15 @@ Value getblocktemplate(const Array& params, bool fHelp)
" \"enforce_systemnode_payments\" : true|false (boolean) true, if systemnode payments are enforced\n"
" \"payeeSN\" : \"xxx\", (string) required systemnode payee for the next block\n"
" \"payeeSN_amount\" : n, (numeric) required amount to pay systemnode \n"
" \"superblock\" : [ (array) required superblock payees that must be included in the next block\n"
" {\n"
" \"payee\" : \"xxxx\", (string) payee address\n"
" \"script\" : \"xxxx\", (string) payee scriptPubKey\n"
" \"amount\": n (numeric) required amount to pay\n"
" }\n"
" ,...\n"
" ],\n"
" \"superblocks_enabled\" : true|false (boolean) true, if superblock payments are enabled\n"
"}\n"
"\nExamples:\n"
......@@ -634,34 +645,65 @@ Value getblocktemplate(const Array& params, bool fHelp)
result.push_back(Pair("height", (int64_t)(pindexPrev->nHeight+1)));
result.push_back(Pair("votes", aVotes));
if(pblock->payee != CScript()){
if (pblock->payee != CScript())
{
CTxDestination address1;
ExtractDestination(pblock->payee, address1);
CBitcoinAddress address2(address1);
result.push_back(Pair("payee", address2.ToString().c_str()));
result.push_back(Pair("payee_amount", (int64_t)pblock->vtx[0].vout[1].nValue));
} else {
}
else
{
result.push_back(Pair("payee", ""));
result.push_back(Pair("payee_amount", ""));
}
result.push_back(Pair("masternode_payments", pblock->nTime > Params().StartMasternodePayments()));
result.push_back(Pair("enforce_masternode_payments", true));
result.push_back(Pair("systemnode_payments", pblock->nTime > Params().StartMasternodePayments()));
result.push_back(Pair("enforce_systemnode_payments", true));
if(pblock->payeeSN != CScript()){
if (pblock->payeeSN != CScript())
{
CTxDestination address1;
ExtractDestination(pblock->payeeSN, address1);
CBitcoinAddress address2(address1);
result.push_back(Pair("payeeSN", address2.ToString().c_str()));
result.push_back(Pair("payeeSN_amount", (int64_t)pblock->vtx[0].vout[2].nValue));
} else {
}
else
{
result.push_back(Pair("payeeSN", ""));
result.push_back(Pair("payeeSN_amount", ""));
}
result.push_back(Pair("enforce_masternode_payments", true));
result.push_back(Pair("enforce_systemnode_payments", true));
Array superblockObjArray;
if (IsSporkActive(SPORK_13_ENABLE_SUPERBLOCKS) && budget.IsBudgetPaymentBlock(pindexPrev->nHeight + 1))
{
// Don't pay masternodes/systemnodes
result.push_back(Pair("masternode_payments", false));
result.push_back(Pair("systemnode_payments", false));
// pblock->vtx[0].vout[0] is for miner
for (unsigned int i = 1; i < pblock->vtx[0].vout.size(); i++)
{
Object entry;
CTxDestination address;
CTxOut out = pblock->vtx[0].vout[i];
ExtractDestination(out.scriptPubKey, address);
CBitcoinAddress address2(address);
entry.push_back(Pair("payee", address2.ToString().c_str()));
entry.push_back(Pair("script", HexStr(out.scriptPubKey)));
entry.push_back(Pair("amount", out.nValue));
superblockObjArray.push_back(entry);
}
}
else
{
result.push_back(Pair("masternode_payments", true));
result.push_back(Pair("systemnode_payments", true));
}
result.push_back(Pair("superblock", superblockObjArray));
result.push_back(Pair("superblocks_enabled", IsSporkActive(SPORK_13_ENABLE_SUPERBLOCKS)));
return result;
}
......
......@@ -9,35 +9,35 @@
/**
* network protocol versioning
*/
static const int PROTOCOL_VERSION = 70053;
static const int PROTOCOL_VERSION = 70054;
//! initial 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_PREV = 70052;
static const int MIN_PEER_PROTO_VERSION_CURR = 70053;
static const int MIN_PEER_PROTO_VERSION_PREV = 70053;
static const int MIN_PEER_PROTO_VERSION_CURR = 70054;
//! minimum peer version accepted by legacySigner
static const int MIN_POOL_PEER_PROTO_VERSION = 70052;
static const int MIN_POOL_PEER_PROTO_VERSION = 70053;
//! minimum peer version for masternode budgets
static const int MIN_BUDGET_PEER_PROTO_VERSION = 70052;
static const int MIN_BUDGET_PEER_PROTO_VERSION = 70053;
//! minimum peer version for masternode winner broadcasts
static const int MIN_MNW_PEER_PROTO_VERSION = 70052;
static const int MIN_MNW_PEER_PROTO_VERSION = 70053;
//! minimum peer version that can receive masternode payments
// V1 - Last protocol version before update
// V2 - Newest protocol version
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_PREV = 70052;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_CURR = 70053;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_PREV = 70053;
static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_CURR = 70054;
//! minimum peer version that can receive systemnode payments
// V1 - Last protocol version before update
// V2 - Newest protocol version
static const int MIN_SYSTEMNODE_PAYMENT_PROTO_VERSION_PREV = 70052;
static const int MIN_SYSTEMNODE_PAYMENT_PROTO_VERSION_CURR = 70053;
static const int MIN_SYSTEMNODE_PAYMENT_PROTO_VERSION_PREV = 70053;
static const int MIN_SYSTEMNODE_PAYMENT_PROTO_VERSION_CURR = 70054;
//! nTime field added to CAddress, starting with this version;
//! if possible, avoid requesting addresses nodes older than this
......
{
"Linux32":{
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.1/Crown-Linux32.zip",
"sha256sum":"3a57ffd76900d638436b7cb8e90310b1821cafaf6114f83cc41daa76aa1b5412"
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.2/Crown-0.12.5.2-Linux32.zip",
"sha256sum":"3d7127151f9c6b1a2f10fefaf0861fc916cdc4f088a471a47c1f8578ac6f8ab4"
},
"Linux64":{
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.1/Crown-Linux64.zip",
"sha256sum":"5ee7cf4e1b1ecde34328b169ce7ad34eacb510257de9f1a0287d181a8ecb7632"
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.2/Crown-0.12.5.2-Linux64.zip",
"sha256sum":"bc6443e6793816d3fb2aee4f688e94937daac742c38fe1f53da04de693c70b30"
},
"Osx":{
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.1/Crown-Osx.zip",
"sha256sum":"46a5c027202c2e894b40de7217fc045ae89da37324f34d7be5e83b1713419289"
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.2/Crown-0.12.5.2-Osx.zip",
"sha256sum":"4d1b33f3eb6cbd708a51b914bef1e9b4d35cb44dfdd7bb35c39deb713aa03b84"
},
"Win32":{
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.1/Crown-Win32.zip",
"sha256sum":"05d2d21872acc63b52589d916f35c18187a998a844c1a3b678cbf571d2ed9472"
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.2/Crown-0.12.5.2-Win32.zip",
"sha256sum":"566e9a12dbdc5eab40ac9ba3d240c9245b0b3f1fefd1ce54fc9f82579d822ad4"
},
"Win64":{
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.1/Crown-Win64.zip",
"sha256sum":"50e591f009ad36942597070b07a748241ad9180e00e249f73597d6f252e103c1"
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.2/Crown-0.12.5.2-Win64.zip",
"sha256sum":"ada91f099d7faa4ae75e5016c24fbd8066357cd1398f063bc1cba92ae864bfb9"
},
"RaspberryPi":{
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.1/Crown-RaspberryPi.zip",
"sha256sum":"b60cf24a498ea49172879a6c7c85989712107232ce1e30fc655224bd44abe720"
"Url":"https://github.com/Crowndev/crowncoin/releases/download/v0.12.5.2/Crown-0.12.5.2-RaspberryPi.zip",
"sha256sum":"1a48f66dbff26cb81fcf52c29e8bc66ac17a9e4283baff46fc21aeec5490362e"
},
"Version":120501,
"Version":120502,
"NeedToBeUpdated": true
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment