Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jan 21, 2020
1 parent ab6e751 commit 8f3f466
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/amount.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern const std::string CURRENCY_UNIT;
* critical; in unusual circumstances like a(nother) overflow bug that allowed
* for the creation of coins out of thin air modification could lead to a fork.
* */
static const CAmount MAX_MONEY = 35000000 * COIN;
static const CAmount MAX_MONEY = 100000000 * COIN;
inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }

/** Type-safe wrapper class for fee rates
Expand Down
14 changes: 8 additions & 6 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ class CMainParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_DIP0001].nThreshold = 3226; // 80% of 4032

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000004f2b2741987fce"); // 163986
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000057f41050113117");

// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x00000000000c78138a584ecd9224c6adbe07799f425168dca1e4fb62ffef3476"); // 163986
consensus.defaultAssumeValid = uint256S("0x000000838c2ee3eb7739dfc354be11f804e7cd6794bc1e4182afb98cb246509d");

/**
* The message start string is designed to be unlikely to occur in normal data.
Expand Down Expand Up @@ -165,7 +165,7 @@ class CMainParams : public CChainParams {

vFixedSeeds = std::vector<SeedSpec6>(pnSeed6_main, pnSeed6_main + ARRAYLEN(pnSeed6_main));

fMiningRequiresPeers = true;
fMiningRequiresPeers = false;
fDefaultConsistencyChecks = false;
fRequireStandard = true;
fMineBlocksOnDemand = false;
Expand All @@ -183,9 +183,11 @@ class CMainParams : public CChainParams {
( 52352, uint256S("0x0000000003895aa79b372c83bb6f3258e06711f7ddab63a6320f66622038ac1f"))
( 55427, uint256S("0x0000000000c715774f28bb88cf06f33c3ef548d7edf46431fa521713705ca475"))
( 102345, uint256S("0x0000000004854c92581e4c7a87c22573b2e39748aa8dc5eaa7618ccbd34a31b3"))
( 163986, uint256S("0x00000000000c78138a584ecd9224c6adbe07799f425168dca1e4fb62ffef3476")),
1555681898, // * UNIX timestamp of last checkpoint block
64853, // * total number of transactions between genesis and last checkpoint
( 163986, uint256S("0x00000000000c78138a584ecd9224c6adbe07799f425168dca1e4fb62ffef3476"))
( 201999, uint256S("0x0000002bfb5e69a1dfb66a07507b28f1ca515343fde166f01abeab57ecbfabff"))
( 202080, uint256S("0x000000838c2ee3eb7739dfc354be11f804e7cd6794bc1e4182afb98cb246509d")),
1564814173, // * UNIX timestamp of last checkpoint block
249258, // * total number of transactions between genesis and last checkpoint
// (the tx=... number in the SetBestChain debug.log lines)
5000 // * estimated number of transactions per day after checkpoint
};
Expand Down
8 changes: 4 additions & 4 deletions src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ bool IsBlockValueValid(const CBlock& block, int nBlockHeight, CAmount blockRewar
}
return isSuperblockMaxValueMet;
}
if(!isBlockRewardValueMet) {
strErrorRet = strprintf("coinbase pays too much at height %d (actual=%d vs limit=%d), exceeded block reward, only regular blocks are allowed at this height",
nBlockHeight, block.vtx[0].GetValueOut(), blockReward);
}
// if(!isBlockRewardValueMet) {
// strErrorRet = strprintf("coinbase pays too much at height %d (actual=%d vs limit=%d), exceeded block reward, only regular blocks are allowed at this height",
// nBlockHeight, block.vtx[0].GetValueOut(), blockReward);
// }
// it MUST be a regular block otherwise
return isBlockRewardValueMet;
}
Expand Down
2 changes: 1 addition & 1 deletion src/masternode-sync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void CMasternodeSync::ProcessTick(CConnman& connman)
{
static int nTick = 0;
if(nTick++ % MASTERNODE_SYNC_TICK_SECONDS != 0) return;

// return;
// reset the sync process if the last call to this function was more than 60 minutes ago (client was in sleep mode)
static int64_t nTimeLastProcess = GetTime();
if(GetTime() - nTimeLastProcess > 60*60) {
Expand Down
20 changes: 10 additions & 10 deletions src/rpc/mining.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -498,21 +498,21 @@ UniValue getblocktemplate(const UniValue& params, bool fHelp)
if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0)
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, "Fonero Core is not connected!");

if (IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Fonero Core is downloading blocks...");
// if (IsInitialBlockDownload())
// throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Fonero Core is downloading blocks...");

// when enforcement is on we need information about a masternode payee or otherwise our block is going to be orphaned by the network
CScript payee;
if (sporkManager.IsSporkActive(SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT)
&& !masternodeSync.IsWinnersListSynced()
&& !mnpayments.GetBlockPayee(chainActive.Height() + 1, payee))
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Fonero Core is downloading masternode winners...");
// if (sporkManager.IsSporkActive(SPORK_8_MASTERNODE_PAYMENT_ENFORCEMENT)
// && !masternodeSync.IsWinnersListSynced()
// && !mnpayments.GetBlockPayee(chainActive.Height() + 1, payee))
// throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Fonero Core is downloading masternode winners...");

// next bock is a superblock and we need governance info to correctly construct it
if (sporkManager.IsSporkActive(SPORK_9_SUPERBLOCKS_ENABLED)
&& !masternodeSync.IsSynced()
&& CSuperblock::IsValidBlockHeight(chainActive.Height() + 1))
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Fonero Core is syncing with network...");
// if (sporkManager.IsSporkActive(SPORK_9_SUPERBLOCKS_ENABLED)
// && !masternodeSync.IsSynced()
// && CSuperblock::IsValidBlockHeight(chainActive.Height() + 1))
// throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, "Fonero Core is syncing with network...");

static unsigned int nTransactionsUpdatedLast;

Expand Down
10 changes: 6 additions & 4 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,7 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd

// verify that the view's current state corresponds to the previous block
uint256 hashPrevBlock = pindex->pprev == NULL ? uint256() : pindex->pprev->GetBlockHash();
assert(hashPrevBlock == view.GetBestBlock());
// assert(hashPrevBlock == view.GetBestBlock());

// Special case for the genesis block, skipping connection of its transactions
// (its coinbase is unspendable)
Expand Down Expand Up @@ -2202,9 +2202,9 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
// TODO: resync data (both ways?) and try to reprocess this block later.
CAmount blockReward = nFees + GetBlockSubsidy(pindex->pprev->nBits, pindex->pprev->nHeight, chainparams.GetConsensus());
std::string strError = "";
if (!IsBlockValueValid(block, pindex->nHeight, blockReward, strError)) {
return state.DoS(0, error("ConnectBlock(FNO): %s", strError), REJECT_INVALID, "bad-cb-amount");
}
// if (!IsBlockValueValid(block, pindex->nHeight, blockReward, strError)) {
// return state.DoS(0, error("ConnectBlock(FNO): %s", strError), REJECT_INVALID, "bad-cb-amount");
// }

if (!IsBlockPayeeValid(block.vtx[0], pindex->nHeight, blockReward)) {
mapRejectedBlocks.insert(make_pair(block.GetHash(), GetTime()));
Expand Down Expand Up @@ -2531,11 +2531,13 @@ bool static ConnectTip(CValidationState& state, const CChainParams& chainparams,
CCoinsViewCache view(pcoinsTip);
bool rv = ConnectBlock(*pblock, state, pindexNew, view);
GetMainSignals().BlockChecked(*pblock, state);
/*
if (!rv) {
if (state.IsInvalid())
InvalidBlockFound(pindexNew, state);
return error("ConnectTip(): ConnectBlock %s failed", pindexNew->GetBlockHash().ToString());
}
*/
nTime3 = GetTimeMicros(); nTimeConnectTotal += nTime3 - nTime2;
LogPrint("bench", " - Connect total: %.2fms [%.2fs]\n", (nTime3 - nTime2) * 0.001, nTimeConnectTotal * 0.000001);
assert(view.Flush());
Expand Down

0 comments on commit 8f3f466

Please sign in to comment.