diff options
| author | rfree2monero <rfreemonero@op.pl> | 2015-02-20 22:28:03 +0100 |
|---|---|---|
| committer | rfree2monero <rfreemonero@op.pl> | 2015-02-20 22:28:03 +0100 |
| commit | ae2a50659f7dc74a5446a0dc3a5f8f78563b9e1f (patch) | |
| tree | 0d1e7332174fdad966a3048b6b12daee4d07f367 /src/cryptonote_core/cryptonote_core.cpp | |
| parent | 0f06dca83197e317384609c8c7e1413289a1be03 (diff) | |
| download | monzero-core-ae2a50659f7dc74a5446a0dc3a5f8f78563b9e1f.tar.gz monzero-core-ae2a50659f7dc74a5446a0dc3a5f8f78563b9e1f.tar.xz monzero-core-ae2a50659f7dc74a5446a0dc3a5f8f78563b9e1f.zip | |
2014 network limit 1.2 +utils +toc -doc -drmonero
new update of the pr with network limits
more debug options:
discarding downloaded blocks all or after given height.
trying to trigger the locking errors.
debug levels polished/tuned to sane values.
debug/logging improved.
warning: this pr should be correct code, but it could make
an existing (in master version) locking error appear more often.
it's a race on the list (map) of peers, e.g. between closing/deleting
them versus working on them in net-limit sleep in sending chunk.
the bug is not in this code/this pr, but in the master version.
the locking problem of master will be fixed in other pr.
problem is ub, and in practice is seems to usually cause program abort
(tested on debian stable with updated gcc). see --help for option
to add sleep to trigger the error faster.
Diffstat (limited to 'src/cryptonote_core/cryptonote_core.cpp')
| -rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index c8daa3510..49ce63065 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -206,14 +206,30 @@ namespace cryptonote return m_fast_exit; } //----------------------------------------------------------------------------------------------- - void core::no_check_blocks() + void core::test_drop_download() { - m_check_blocks = false; + m_test_drop_download = false; } //----------------------------------------------------------------------------------------------- - bool core::get_check_blocks() + void core::test_drop_download_height(uint64_t height) { - return m_check_blocks; + m_test_drop_download_height = height; + } + //----------------------------------------------------------------------------------------------- + bool core::get_test_drop_download() + { + return m_test_drop_download; + } + //----------------------------------------------------------------------------------------------- + bool core::get_test_drop_download_height() + { + if (m_test_drop_download_height == 0) + return true; + + if (get_blockchain_storage().get_current_blockchain_height() <= m_test_drop_download_height) + return true; + + return false; } //----------------------------------------------------------------------------------------------- bool core::handle_incoming_tx(const blobdata& tx_blob, tx_verification_context& tvc, bool keeped_by_block) |
