|
|
@ -896,12 +896,12 @@ bool AcceptToMemoryPool(CTxMemPool& pool, CValidationState &state, const CTransa |
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
CCoinsView dummy; |
|
|
|
CCoinsView dummy; |
|
|
|
CCoinsViewCache view(dummy); |
|
|
|
CCoinsViewCache view(&dummy); |
|
|
|
|
|
|
|
|
|
|
|
int64_t nValueIn = 0; |
|
|
|
int64_t nValueIn = 0; |
|
|
|
{ |
|
|
|
{ |
|
|
|
LOCK(pool.cs); |
|
|
|
LOCK(pool.cs); |
|
|
|
CCoinsViewMemPool viewMemPool(*pcoinsTip, pool); |
|
|
|
CCoinsViewMemPool viewMemPool(pcoinsTip, pool); |
|
|
|
view.SetBackend(viewMemPool); |
|
|
|
view.SetBackend(viewMemPool); |
|
|
|
|
|
|
|
|
|
|
|
// do we already have it?
|
|
|
|
// do we already have it?
|
|
|
@ -1835,7 +1835,7 @@ bool static DisconnectTip(CValidationState &state) { |
|
|
|
// Apply the block atomically to the chain state.
|
|
|
|
// Apply the block atomically to the chain state.
|
|
|
|
int64_t nStart = GetTimeMicros(); |
|
|
|
int64_t nStart = GetTimeMicros(); |
|
|
|
{ |
|
|
|
{ |
|
|
|
CCoinsViewCache view(*pcoinsTip, true); |
|
|
|
CCoinsViewCache view(pcoinsTip); |
|
|
|
if (!DisconnectBlock(block, state, pindexDelete, view)) |
|
|
|
if (!DisconnectBlock(block, state, pindexDelete, view)) |
|
|
|
return error("DisconnectTip() : DisconnectBlock %s failed", pindexDelete->GetBlockHash().ToString()); |
|
|
|
return error("DisconnectTip() : DisconnectBlock %s failed", pindexDelete->GetBlockHash().ToString()); |
|
|
|
assert(view.Flush()); |
|
|
|
assert(view.Flush()); |
|
|
@ -1888,7 +1888,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock * |
|
|
|
int64_t nTime3; |
|
|
|
int64_t nTime3; |
|
|
|
LogPrint("bench", " - Load block from disk: %.2fms [%.2fs]\n", (nTime2 - nTime1) * 0.001, nTimeReadFromDisk * 0.000001); |
|
|
|
LogPrint("bench", " - Load block from disk: %.2fms [%.2fs]\n", (nTime2 - nTime1) * 0.001, nTimeReadFromDisk * 0.000001); |
|
|
|
{ |
|
|
|
{ |
|
|
|
CCoinsViewCache view(*pcoinsTip, true); |
|
|
|
CCoinsViewCache view(pcoinsTip); |
|
|
|
CInv inv(MSG_BLOCK, pindexNew->GetBlockHash()); |
|
|
|
CInv inv(MSG_BLOCK, pindexNew->GetBlockHash()); |
|
|
|
if (!ConnectBlock(*pblock, state, pindexNew, view)) { |
|
|
|
if (!ConnectBlock(*pblock, state, pindexNew, view)) { |
|
|
|
if (state.IsInvalid()) |
|
|
|
if (state.IsInvalid()) |
|
|
@ -2936,7 +2936,7 @@ bool CVerifyDB::VerifyDB(CCoinsView *coinsview, int nCheckLevel, int nCheckDepth |
|
|
|
nCheckDepth = chainActive.Height(); |
|
|
|
nCheckDepth = chainActive.Height(); |
|
|
|
nCheckLevel = std::max(0, std::min(4, nCheckLevel)); |
|
|
|
nCheckLevel = std::max(0, std::min(4, nCheckLevel)); |
|
|
|
LogPrintf("Verifying last %i blocks at level %i\n", nCheckDepth, nCheckLevel); |
|
|
|
LogPrintf("Verifying last %i blocks at level %i\n", nCheckDepth, nCheckLevel); |
|
|
|
CCoinsViewCache coins(*coinsview, true); |
|
|
|
CCoinsViewCache coins(coinsview); |
|
|
|
CBlockIndex* pindexState = chainActive.Tip(); |
|
|
|
CBlockIndex* pindexState = chainActive.Tip(); |
|
|
|
CBlockIndex* pindexFailure = NULL; |
|
|
|
CBlockIndex* pindexFailure = NULL; |
|
|
|
int nGoodTransactions = 0; |
|
|
|
int nGoodTransactions = 0; |
|
|
|