Auto merge of #4396 - daira:minimize-zip207-diff, r=str4d

Fix typos/minor error in comments, and wrap some lines

This minimizes the diff in the example implementation of funding streams in ZIP 207.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Homu 2020-03-12 10:51:55 +00:00
commit 8b600df660
2 changed files with 11 additions and 8 deletions

View File

@ -328,7 +328,7 @@ public:
// a minimum difficulty block can be mined if no block is mined normally within 15 minutes): // a minimum difficulty block can be mined if no block is mined normally within 15 minutes):
// <https://zips.z.cash/zip-0205#change-to-difficulty-adjustment-on-testnet> // <https://zips.z.cash/zip-0205#change-to-difficulty-adjustment-on-testnet>
// However the median-time-past is 6 blocks behind, and the worst-case time for 7 blocks at a // However the median-time-past is 6 blocks behind, and the worst-case time for 7 blocks at a
// 15-minute spacing is ~105 minutes, which is exceeds the limit imposed by the soft fork of // 15-minute spacing is ~105 minutes, which exceeds the limit imposed by the soft fork of
// 90 minutes. // 90 minutes.
// //
// After Blossom, the minimum difficulty threshold time is changed to 6 times the block target // After Blossom, the minimum difficulty threshold time is changed to 6 times the block target

View File

@ -3934,7 +3934,8 @@ bool ContextualCheckBlock(
? pindexPrev->GetMedianTimePast() ? pindexPrev->GetMedianTimePast()
: block.GetBlockTime(); : block.GetBlockTime();
if (!IsFinalTx(tx, nHeight, nLockTimeCutoff)) { if (!IsFinalTx(tx, nHeight, nLockTimeCutoff)) {
return state.DoS(10, error("%s: contains a non-final transaction", __func__), REJECT_INVALID, "bad-txns-nonfinal"); return state.DoS(10, error("%s: contains a non-final transaction", __func__),
REJECT_INVALID, "bad-txns-nonfinal");
} }
} }
@ -3947,15 +3948,16 @@ bool ContextualCheckBlock(
CScript expect = CScript() << nHeight; CScript expect = CScript() << nHeight;
if (block.vtx[0].vin[0].scriptSig.size() < expect.size() || if (block.vtx[0].vin[0].scriptSig.size() < expect.size() ||
!std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin())) { !std::equal(expect.begin(), expect.end(), block.vtx[0].vin[0].scriptSig.begin())) {
return state.DoS(100, error("%s: block height mismatch in coinbase", __func__), REJECT_INVALID, "bad-cb-height"); return state.DoS(100, error("%s: block height mismatch in coinbase", __func__),
REJECT_INVALID, "bad-cb-height");
} }
} }
// Coinbase transaction must include an output sending 20% of // Coinbase transaction must include an output sending 20% of
// the block reward to a founders reward script, until the last founders // the block subsidy to a Founders' Reward script, until the last Founders'
// reward block is reached, with exception of the genesis block. // Reward block is reached, with exception of the genesis block.
// The last founders reward block is defined as the block just before the // The last Founders' Reward block is defined as the block just before the
// first subsidy halving block, which occurs at halving_interval + slow_start_shift // first subsidy halving block, which occurs at halving_interval + slow_start_shift.
if ((nHeight > 0) && (nHeight <= consensusParams.GetLastFoundersRewardBlockHeight(nHeight))) { if ((nHeight > 0) && (nHeight <= consensusParams.GetLastFoundersRewardBlockHeight(nHeight))) {
bool found = false; bool found = false;
@ -3969,7 +3971,8 @@ bool ContextualCheckBlock(
} }
if (!found) { if (!found) {
return state.DoS(100, error("%s: founders reward missing", __func__), REJECT_INVALID, "cb-no-founders-reward"); return state.DoS(100, error("%s: founders reward missing", __func__),
REJECT_INVALID, "cb-no-founders-reward");
} }
} }