Skip to content

Commit

Permalink
Merge pull request #12 from mkwia/new-bip148-specification
Browse files Browse the repository at this point in the history
new bip148 specification
  • Loading branch information
UASF committed Mar 29, 2017
2 parents 3186dc8 + d475db7 commit 2e15742
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/clientversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,6 @@ std::string FormatSubVersion(const std::string& name, int nClientVersion, const
}
ss << "/";
if (!fBaseNameOnly)
ss << "UASF-Segwit:0.1.1(BIP148)/";
ss << "UASF-Segwit:0.2(BIP148)/";
return ss.str();
}
17 changes: 10 additions & 7 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1851,13 +1851,16 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
flags |= SCRIPT_VERIFY_NULLDUMMY;
}

// mandatory segwit activation between Oct 1st 2017 and Nov 15th 2017 inclusive
if (pindex->GetMedianTimePast() >= 1506816000 && // Sun Oct 1 00:00:00 UTC 2017
pindex->GetMedianTimePast() <= 1510704000 && // Wed Nov 15 00:00:00 UTC 2017
!IsWitnessEnabled(pindex->pprev, chainparams.GetConsensus()) && // segwit not activated yet
((pindex->nVersion & VERSIONBITS_TOP_MASK) != VERSIONBITS_TOP_BITS || // no BIP9 or no segwit
(pindex->nVersion & VersionBitsMask(chainparams.GetConsensus(), Consensus::DEPLOYMENT_SEGWIT)) == 0)) {
return state.DoS(0, error("ConnectBlock(): relayed block must signal for segwit, please upgrade"), REJECT_INVALID, "bad-no-segwit");
// BIP148 mandatory segwit signalling.
if (pindex->GetMedianTimePast() >= 1501545600 && // Tue 1 Aug 2017 00:00:00 UTC
pindex->GetMedianTimePast() <= 1510704000 && // Wed 15 Nov 2017 00:00:00 UTC
!IsWitnessEnabled(pindex->pprev, chainparams.GetConsensus()))
{
// versionbits topbit and segwit flag must be set.
if ((pindex->nVersion & VERSIONBITS_TOP_MASK) != VERSIONBITS_TOP_BITS ||
(pindex->nVersion & VersionBitsMask(chainparams.GetConsensus(), Consensus::DEPLOYMENT_SEGWIT)) == 0) {
return state.DoS(0, error("ConnectBlock(): relayed block must signal for segwit, please upgrade"), REJECT_INVALID, "bad-no-segwit");
}
}

int64_t nTime2 = GetTimeMicros(); nTimeForks += nTime2 - nTime1;
Expand Down

0 comments on commit 2e15742

Please sign in to comment.