wownero/src/cryptonote_core
moneromooo-monero 0fd6ccef21
blockchain: fix timestamp/difficulty cache getting out of sync
The cache is discarded when a block is popped, but then gets
rebuilt when the difficulty for next block is requested.
While this is all properly locked, it does not take into account
the delay caused by a database transaction being only committed
(and thus its effects made visible to other threads) later on,
which means another thread could request difficulty between
the pop and the commit, which would end up using stale database
view to build the cache, but that cache would not be invalidated
again when the transaction gets committed, which would cause the
cache to not match the new database data.

To fix this, we now keep track of when the cache is invalidated
so we can invalidate it again upon database transaction commit
to ensure it gets calculated again with fresh data next time it
is nedeed.
2020-07-08 22:31:51 +00:00
..
CMakeLists.txt core: move hardforks into its own lib 2019-09-19 11:28:18 +00:00
blockchain.cpp blockchain: fix timestamp/difficulty cache getting out of sync 2020-07-08 22:31:51 +00:00
blockchain.h blockchain: fix timestamp/difficulty cache getting out of sync 2020-07-08 22:31:51 +00:00
blockchain_storage_boost_serialization.h Update 2019 copyright 2019-03-05 22:05:34 +01:00
cryptonote_core.cpp cryptonote_core: remove "We are most likely forked" message 2020-05-19 16:27:24 +00:00
cryptonote_core.h cryptonote_core: remove "We are most likely forked" message 2020-05-19 16:27:24 +00:00
cryptonote_tx_utils.cpp Merge pull request #6436 2020-05-01 15:20:05 -05:00
cryptonote_tx_utils.h RandomX integration 2019-09-25 21:29:42 +01:00
i_core_events.h Adding support for hidden (anonymity) txpool 2019-11-02 20:36:03 +00:00
tx_pool.cpp Fix D++ block template check 2020-06-12 22:05:52 -04:00
tx_pool.h Always reject duplicate key-images from second txid 2020-03-30 17:52:42 +00:00
tx_sanity_check.cpp wallet: reroll fake outs selection on local tx_sanity_check failure 2020-01-14 22:56:23 +00:00
tx_sanity_check.h wallet: reroll fake outs selection on local tx_sanity_check failure 2020-01-14 22:56:23 +00:00