X-Git-Url: https://git.novaco.in/?a=blobdiff_plain;f=src%2Fmain.cpp;h=970dd7e8d705eb6a22c9d831a08c790ec6a9e16f;hb=3bdc0abd5d7e262151c62426cb3006433fb21ffc;hp=c8769af41de0ba9d157671a26d79c5f6c941b98a;hpb=3833b4e69b7fb9cca574cbead4a765fff0663f16;p=novacoin.git diff --git a/src/main.cpp b/src/main.cpp index c8769af..970dd7e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1762,7 +1762,8 @@ bool CBlock::ConnectBlock(CTxDB& txdb, CBlockIndex* pindex, bool fJustCheck) if (tx.nTime >= CHECKLOCKTIMEVERIFY_SWITCH_TIME) { nFlags |= SCRIPT_VERIFY_CHECKLOCKTIMEVERIFY; - nFlags |= SCRIPT_VERIFY_CHECKSEQUENCEVERIFY; + // OP_CHECKSEQUENCEVERIFY is senseless without BIP68, so we're going disable it for now. + // nFlags |= SCRIPT_VERIFY_CHECKSEQUENCEVERIFY; } std::vector vChecks; @@ -2346,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 (pindexPrev->nTime < 1450569600) - nMaxOffset = 7 * 86400; // One week until 20 Dec, 2015 + nMaxOffset = nOneWeek; // One week until 20 Dec, 2015 // Check timestamp against prev if (GetBlockTime() <= nMedianTimePast || FutureDrift(GetBlockTime()) < pindexPrev->GetBlockTime()) @@ -3720,23 +3721,20 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) else if (strCommand == "ping") { - if (pfrom->nVersion > BIP0031_VERSION) - { - uint64_t nonce = 0; - vRecv >> nonce; - // Echo the message back with the nonce. This allows for two useful features: - // - // 1) A remote node can quickly check if the connection is operational - // 2) Remote nodes can measure the latency of the network thread. If this node - // is overloaded it won't respond to pings quickly and the remote node can - // avoid sending us more work, like chain download requests. - // - // The nonce stops the remote getting confused between different pings: without - // it, if the remote node sends a ping once per second and this node takes 5 - // seconds to respond to each, the 5th ping the remote sends would appear to - // return very quickly. - pfrom->PushMessage("pong", nonce); - } + uint64_t nonce = 0; + vRecv >> nonce; + // Echo the message back with the nonce. This allows for two useful features: + // + // 1) A remote node can quickly check if the connection is operational + // 2) Remote nodes can measure the latency of the network thread. If this node + // is overloaded it won't respond to pings quickly and the remote node can + // avoid sending us more work, like chain download requests. + // + // The nonce stops the remote getting confused between different pings: without + // it, if the remote node sends a ping once per second and this node takes 5 + // seconds to respond to each, the 5th ping the remote sends would appear to + // return very quickly. + pfrom->PushMessage("pong", nonce); } @@ -3920,10 +3918,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle) // right now. if (pto->nLastSend && GetTime() - pto->nLastSend > nPingInterval && pto->vSend.empty()) { uint64_t nonce = 0; - if (pto->nVersion > BIP0031_VERSION) - pto->PushMessage("ping", nonce); - else - pto->PushMessage("ping"); + pto->PushMessage("ping", nonce); } // Start block sync