Disable enforced coinbase protection in miner_tests.
This commit is contained in:
parent
a180d0a6c6
commit
d212ba320b
|
@ -62,6 +62,7 @@ bool fPruneMode = false;
|
||||||
bool fIsBareMultisigStd = true;
|
bool fIsBareMultisigStd = true;
|
||||||
bool fCheckBlockIndex = false;
|
bool fCheckBlockIndex = false;
|
||||||
bool fCheckpointsEnabled = true;
|
bool fCheckpointsEnabled = true;
|
||||||
|
bool fCoinbaseEnforcedProtectionEnabled = true;
|
||||||
size_t nCoinCacheUsage = 5000 * 300;
|
size_t nCoinCacheUsage = 5000 * 300;
|
||||||
uint64_t nPruneTarget = 0;
|
uint64_t nPruneTarget = 0;
|
||||||
bool fAlerts = DEFAULT_ALERTS;
|
bool fAlerts = DEFAULT_ALERTS;
|
||||||
|
@ -1631,7 +1632,9 @@ bool NonContextualCheckInputs(const CTransaction& tx, CValidationState &state, c
|
||||||
if (coins->IsCoinBase()) {
|
if (coins->IsCoinBase()) {
|
||||||
// Ensure that coinbases cannot be spent to transparent outputs
|
// Ensure that coinbases cannot be spent to transparent outputs
|
||||||
// Disabled on regtest
|
// Disabled on regtest
|
||||||
if (consensusParams.fCoinbaseMustBeProtected && !tx.vout.empty()) {
|
if (fCoinbaseEnforcedProtectionEnabled &&
|
||||||
|
consensusParams.fCoinbaseMustBeProtected &&
|
||||||
|
!tx.vout.empty()) {
|
||||||
return state.Invalid(
|
return state.Invalid(
|
||||||
error("CheckInputs(): tried to spend coinbase with transparent outputs"),
|
error("CheckInputs(): tried to spend coinbase with transparent outputs"),
|
||||||
REJECT_INVALID, "bad-txns-coinbase-spend-has-transparent-outputs");
|
REJECT_INVALID, "bad-txns-coinbase-spend-has-transparent-outputs");
|
||||||
|
|
|
@ -116,6 +116,9 @@ extern bool fTxIndex;
|
||||||
extern bool fIsBareMultisigStd;
|
extern bool fIsBareMultisigStd;
|
||||||
extern bool fCheckBlockIndex;
|
extern bool fCheckBlockIndex;
|
||||||
extern bool fCheckpointsEnabled;
|
extern bool fCheckpointsEnabled;
|
||||||
|
// TODO: remove this flag by structuring our code such that
|
||||||
|
// it is unneeded for testing
|
||||||
|
extern bool fCoinbaseEnforcedProtectionEnabled;
|
||||||
extern size_t nCoinCacheUsage;
|
extern size_t nCoinCacheUsage;
|
||||||
extern CFeeRate minRelayTxFee;
|
extern CFeeRate minRelayTxFee;
|
||||||
extern bool fAlerts;
|
extern bool fAlerts;
|
||||||
|
|
|
@ -147,6 +147,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
||||||
|
|
||||||
LOCK(cs_main);
|
LOCK(cs_main);
|
||||||
fCheckpointsEnabled = false;
|
fCheckpointsEnabled = false;
|
||||||
|
fCoinbaseEnforcedProtectionEnabled = false;
|
||||||
|
|
||||||
// We can't make transactions until we have inputs
|
// We can't make transactions until we have inputs
|
||||||
// Therefore, load 100 blocks :)
|
// Therefore, load 100 blocks :)
|
||||||
|
@ -417,6 +418,7 @@ BOOST_AUTO_TEST_CASE(CreateNewBlock_validity)
|
||||||
delete tx;
|
delete tx;
|
||||||
|
|
||||||
fCheckpointsEnabled = true;
|
fCheckpointsEnabled = true;
|
||||||
|
fCoinbaseEnforcedProtectionEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_AUTO_TEST_SUITE_END()
|
BOOST_AUTO_TEST_SUITE_END()
|
||||||
|
|
Loading…
Reference in New Issue