X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fmain.cpp;h=1a90e5172df83080463f1b5e6e847cef7a9db243;hp=f8af9dfe7cdf13d02ea871fa009eed1fde13c94e;hb=f2b467c8d7d761dd47e58ad9ed4d8ede92a24601;hpb=f48c974108866253988f6cf88bad5b83b1a0f0b0 diff --git a/src/main.cpp b/src/main.cpp index f8af9df..1a90e51 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -181,10 +181,10 @@ void static Inventory(const uint256& hash) } // ask wallets to resend their transactions -void ResendWalletTransactions() +void ResendWalletTransactions(bool fForceResend) { BOOST_FOREACH(CWallet* pwallet, setpwalletRegistered) - pwallet->ResendWalletTransactions(); + pwallet->ResendWalletTransactions(fForceResend); } @@ -2347,9 +2347,9 @@ bool CBlock::AcceptBlock() return DoS(100, error("AcceptBlock() : incorrect %s", IsProofOfWork() ? "proof-of-work" : "proof-of-stake")); int64_t nMedianTimePast = pindexPrev->GetMedianTimePast(); - int nMaxOffset = 12 * 3600; // 12 hours + int nMaxOffset = 12 * nOneHour; // 12 hours if (fTestNet || pindexPrev->nTime < 1450569600) - nMaxOffset = 7 * 86400; // One week (permanently on testNet or until 20 Dec, 2015 on mainNet) + nMaxOffset = 7 * nOneWeek; // One week (permanently on testNet or until 20 Dec, 2015 on mainNet) // Check timestamp against prev if (GetBlockTime() <= nMedianTimePast || FutureDrift(GetBlockTime()) < pindexPrev->GetBlockTime()) @@ -2528,6 +2528,13 @@ bool ProcessBlock(CNode* pfrom, CBlock* pblock) if (mapOrphanBlocks.count(hash)) return error("ProcessBlock() : already have block (orphan) %s", hash.ToString().substr(0,20).c_str()); + // Check that block isn't listed as unconditionally banned. + if (!Checkpoints::CheckBanned(hash)) { + if (pfrom) + pfrom->Misbehaving(100); + return error("ProcessBlock() : block %s is rejected by hard-coded banlist", hash.GetHex().substr(0,20).c_str()); + } + // Check proof-of-stake // Limited duplicity on stake: prevents block flood attack // Duplicate stake allowed only when there is orphan child block