diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2020-11-29 01:58:13 -0600 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2020-11-29 01:58:13 -0600 |
| commit | 36d31ba0be5df567e9bda0a00c8f94d9dc3f3cc2 (patch) | |
| tree | dd069113b17d67af19909f8bca5747a5e758fa10 /src/cryptonote_core | |
| parent | ad843541d526ef9216f5cfbfd7c18f859964c4d2 (diff) | |
| parent | a9cd5d914e032f2ae6ce56e6b48f0f47d3a56ad7 (diff) | |
| download | monzero-core-36d31ba0be5df567e9bda0a00c8f94d9dc3f3cc2.tar.gz monzero-core-36d31ba0be5df567e9bda0a00c8f94d9dc3f3cc2.tar.xz monzero-core-36d31ba0be5df567e9bda0a00c8f94d9dc3f3cc2.zip | |
Merge pull request #7018
a9cd5d9 cryptonote_core: dandelion - use local height or median height if syncing (xiphon)
Diffstat (limited to 'src/cryptonote_core')
| -rw-r--r-- | src/cryptonote_core/cryptonote_core.cpp | 5 | ||||
| -rw-r--r-- | src/cryptonote_core/cryptonote_core.h | 11 | ||||
| -rw-r--r-- | src/cryptonote_core/i_core_events.h | 3 |
3 files changed, 16 insertions, 3 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index fef411a0c..694f2cc34 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -1510,6 +1510,11 @@ namespace cryptonote return true; } //----------------------------------------------------------------------------------------------- + bool core::is_synchronized() const + { + return m_pprotocol != nullptr && m_pprotocol->is_synchronized(); + } + //----------------------------------------------------------------------------------------------- void core::on_synchronized() { m_miner.on_synchronized(); diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h index b008d026e..6455afdfe 100644 --- a/src/cryptonote_core/cryptonote_core.h +++ b/src/cryptonote_core/cryptonote_core.h @@ -329,7 +329,7 @@ namespace cryptonote * * @note see Blockchain::get_current_blockchain_height() */ - uint64_t get_current_blockchain_height() const; + virtual uint64_t get_current_blockchain_height() const final; /** * @brief get the hash and height of the most recent block @@ -638,6 +638,13 @@ namespace cryptonote std::string print_pool(bool short_format) const; /** + * @brief gets the core synchronization status + * + * @return core synchronization status + */ + virtual bool is_synchronized() const final; + + /** * @copydoc miner::on_synchronized * * @note see miner::on_synchronized @@ -663,7 +670,7 @@ namespace cryptonote * * @param target_blockchain_height the target height */ - virtual uint64_t get_target_blockchain_height() const override; + uint64_t get_target_blockchain_height() const; /** * @brief returns the newest hardfork version known to the blockchain diff --git a/src/cryptonote_core/i_core_events.h b/src/cryptonote_core/i_core_events.h index addb659ab..5d00858b5 100644 --- a/src/cryptonote_core/i_core_events.h +++ b/src/cryptonote_core/i_core_events.h @@ -39,7 +39,8 @@ namespace cryptonote virtual ~i_core_events() noexcept {} - virtual uint64_t get_target_blockchain_height() const = 0; + virtual uint64_t get_current_blockchain_height() const = 0; + virtual bool is_synchronized() const = 0; virtual void on_transactions_relayed(epee::span<const cryptonote::blobdata> tx_blobs, relay_method tx_relay) = 0; }; } |
