Browse Source

Don't use checkpoints and accept nonstd txn on -regtest

tags/v0.15.1
Matt Corallo 7 years ago
parent
commit
d9ace8abe8
2 changed files with 18 additions and 5 deletions
  1. 15
    2
      src/checkpoints.cpp
  2. 3
    3
      src/main.cpp

+ 15
- 2
src/checkpoints.cpp View File

@@ -67,11 +67,24 @@ namespace Checkpoints
300
};

static MapCheckpoints mapCheckpointsRegtest =
boost::assign::map_list_of
( 0, uint256("0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"))
;
static const CCheckpointData dataRegtest = {
&mapCheckpointsRegtest,
0,
0,
0
};

const CCheckpointData &Checkpoints() {
if (TestNet())
if (Params().NetworkID() == CChainParams::TESTNET)
return dataTestnet;
else
else if (Params().NetworkID() == CChainParams::MAIN)
return data;
else
return dataRegtest;
}

bool CheckBlock(int nHeight, const uint256& hash)

+ 3
- 3
src/main.cpp View File

@@ -810,9 +810,9 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fLimitFr
if ((int64)tx.nLockTime > std::numeric_limits<int>::max())
return error("CTxMemPool::accept() : not accepting nLockTime beyond 2038 yet");

// Rather not work on nonstandard transactions (unless -testnet)
// Rather not work on nonstandard transactions (unless -testnet/-regtest)
string reason;
if (!TestNet() && !IsStandardTx(tx, reason))
if (Params().NetworkID() == CChainParams::MAIN && !IsStandardTx(tx, reason))
return error("CTxMemPool::accept() : nonstandard transaction: %s",
reason.c_str());

@@ -888,7 +888,7 @@ bool CTxMemPool::accept(CValidationState &state, CTransaction &tx, bool fLimitFr
}

// Check for non-standard pay-to-script-hash in inputs
if (!TestNet() && !AreInputsStandard(tx, view))
if (Params().NetworkID() == CChainParams::MAIN && !AreInputsStandard(tx, view))
return error("CTxMemPool::accept() : nonstandard transaction input");

// Note: if you modify this code to accept non-standard transactions, then

Loading…
Cancel
Save