Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce CLTV-multi-sig for premine #168

Merged
merged 1 commit into from Nov 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/validation.cpp
Expand Up @@ -3018,6 +3018,24 @@ static bool ContextualCheckBlock(const CBlock& block, CValidationState& state, c
}
}

if (nHeight >= consensusParams.BTGHeight &&
nHeight < consensusParams.BTGHeight + consensusParams.BTGPremineWindow)
{
if (block.vtx[0]->vout.size() != 1) {
return state.DoS(
100, error("%s: only one coinbase output is allowed",__func__),
REJECT_INVALID, "bad-premine-coinbase-output");
}
const CTxOut& output = block.vtx[0]->vout[0];
bool valid = Params().IsPremineAddressScript(output.scriptPubKey, (uint32_t)nHeight);
if (!valid) {
return state.DoS(
100, error("%s: not in premine whitelist", __func__),
REJECT_INVALID, "bad-premine-coinbase-scriptpubkey");
}
}


// Validation for witness commitments.
// * We compute the witness hash (which is the hash including witnesses) of all the block's transactions, except the
// coinbase (where 0x0000....0000 is used instead).
Expand Down