diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main.cpp b/src/main.cpp index d006d83bf5..9de895374e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -803,9 +803,9 @@ bool CTxMemPool::accept(CValidationState &state, const CTransaction &tx, bool fL 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()); @@ -881,7 +881,7 @@ bool CTxMemPool::accept(CValidationState &state, const CTransaction &tx, bool fL } // 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 @@ -1931,7 +1931,7 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew) } // Disconnect shorter branch - vector<CTransaction> vResurrect; + list<CTransaction> vResurrect; BOOST_FOREACH(CBlockIndex* pindex, vDisconnect) { CBlock block; if (!ReadBlockFromDisk(block, pindex)) @@ -1945,9 +1945,9 @@ bool SetBestChain(CValidationState &state, CBlockIndex* pindexNew) // Queue memory transactions to resurrect. // We only do this for blocks after the last checkpoint (reorganisation before that // point should only happen with -reindex/-loadblock, or a misbehaving peer. - BOOST_FOREACH(const CTransaction& tx, block.vtx) + BOOST_REVERSE_FOREACH(const CTransaction& tx, block.vtx) if (!tx.IsCoinBase() && pindex->nHeight > Checkpoints::GetTotalBlocksEstimate()) - vResurrect.push_back(tx); + vResurrect.push_front(tx); } // Connect longer branch |