Skip nonvolatile

This commit is contained in:
jl777
2019-07-02 02:32:01 -11:00
parent 6d09975752
commit 4d6cd8f0b4

View File

@@ -4243,13 +4243,17 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
mapBlockSource.erase(pindexNew->GetBlockHash()); mapBlockSource.erase(pindexNew->GetBlockHash());
nTime3 = GetTimeMicros(); nTimeConnectTotal += nTime3 - nTime2; nTime3 = GetTimeMicros(); nTimeConnectTotal += nTime3 - nTime2;
LogPrint("bench", " - Connect total: %.2fms [%.2fs]\n", (nTime3 - nTime2) * 0.001, nTimeConnectTotal * 0.000001); LogPrint("bench", " - Connect total: %.2fms [%.2fs]\n", (nTime3 - nTime2) * 0.001, nTimeConnectTotal * 0.000001);
if ( KOMODO_NSPV == 0 )
assert(view.Flush()); assert(view.Flush());
} }
int64_t nTime4 = GetTimeMicros(); nTimeFlush += nTime4 - nTime3; int64_t nTime4 = GetTimeMicros(); nTimeFlush += nTime4 - nTime3;
LogPrint("bench", " - Flush: %.2fms [%.2fs]\n", (nTime4 - nTime3) * 0.001, nTimeFlush * 0.000001); LogPrint("bench", " - Flush: %.2fms [%.2fs]\n", (nTime4 - nTime3) * 0.001, nTimeFlush * 0.000001);
// Write the chain state to disk, if necessary. // Write the chain state to disk, if necessary.
if ( KOMODO_NSPV == 0 )
{
if (!FlushStateToDisk(state, FLUSH_STATE_IF_NEEDED)) if (!FlushStateToDisk(state, FLUSH_STATE_IF_NEEDED))
return false; return false;
}
int64_t nTime5 = GetTimeMicros(); nTimeChainState += nTime5 - nTime4; int64_t nTime5 = GetTimeMicros(); nTimeChainState += nTime5 - nTime4;
LogPrint("bench", " - Writing chainstate: %.2fms [%.2fs]\n", (nTime5 - nTime4) * 0.001, nTimeChainState * 0.000001); LogPrint("bench", " - Writing chainstate: %.2fms [%.2fs]\n", (nTime5 - nTime4) * 0.001, nTimeChainState * 0.000001);
// Remove conflicting transactions from the mempool. // Remove conflicting transactions from the mempool.
@@ -4261,6 +4265,8 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
// Update chainActive & related variables. // Update chainActive & related variables.
UpdateTip(pindexNew); UpdateTip(pindexNew);
if ( KOMODO_NSPV == 0 )
{
// Tell wallet about transactions that went from mempool // Tell wallet about transactions that went from mempool
// to conflicted: // to conflicted:
BOOST_FOREACH(const CTransaction &tx, txConflicted) { BOOST_FOREACH(const CTransaction &tx, txConflicted) {
@@ -4270,6 +4276,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
BOOST_FOREACH(const CTransaction &tx, pblock->vtx) { BOOST_FOREACH(const CTransaction &tx, pblock->vtx) {
SyncWithWallets(tx, pblock); SyncWithWallets(tx, pblock);
} }
}
// Update cached incremental witnesses // Update cached incremental witnesses
GetMainSignals().ChainTip(pindexNew, pblock, oldSproutTree, oldSaplingTree, true); GetMainSignals().ChainTip(pindexNew, pblock, oldSproutTree, oldSaplingTree, true);
@@ -4286,6 +4293,8 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
komodo_broadcast(pblock,8); komodo_broadcast(pblock,8);
else if ( ASSETCHAINS_SYMBOL[0] != 0 ) else if ( ASSETCHAINS_SYMBOL[0] != 0 )
komodo_broadcast(pblock,4);*/ komodo_broadcast(pblock,4);*/
if ( KOMODO_NSPV == 0 )
{
if ( ASSETCHAINS_CBOPRET != 0 ) if ( ASSETCHAINS_CBOPRET != 0 )
komodo_pricesupdate(pindexNew->GetHeight(),pblock); komodo_pricesupdate(pindexNew->GetHeight(),pblock);
if ( ASSETCHAINS_SAPLING <= 0 && pindexNew->nTime > KOMODO_SAPLING_ACTIVATION - 24*3600 ) if ( ASSETCHAINS_SAPLING <= 0 && pindexNew->nTime > KOMODO_SAPLING_ACTIVATION - 24*3600 )
@@ -4300,6 +4309,7 @@ bool static ConnectTip(CValidationState &state, CBlockIndex *pindexNew, CBlock *
} }
fprintf(stderr, "snapshot completed in: %lu seconds\n", time(NULL)-start); fprintf(stderr, "snapshot completed in: %lu seconds\n", time(NULL)-start);
} }
}
return true; return true;
} }