diff options
author | Dion Ahmetaj <Dion Ahmetaj> | 2016-10-26 15:00:08 -0400 |
---|---|---|
committer | Dion Ahmetaj <Dion Ahmetaj> | 2016-11-09 14:24:27 -0500 |
commit | d61bd8187e170cd4ae56f5047cc172d257c26237 (patch) | |
tree | e9812862534eda973c6579a13381f8a0b92504a0 /src/cryptonote_core | |
parent | Merge pull request #1272 (diff) | |
download | monero-d61bd8187e170cd4ae56f5047cc172d257c26237.tar.xz |
add lightweight block propagation ("fluffy blocks")
Added a new command to the P2P protocol definitions to allow querying for support flags.
Implemented handling of new support flags command in net_node. Changed for_each callback template to include support flags. Updated print_connections command to show peer support flags.
Added p2p constant for signaling fluffy block support.
Added get_pool_transaction function to cryptnote_core.
Added new commands to cryptonote protocol for relaying fluffy blocks.
Implemented handling of fluffy block command in cryptonote protocol.
Enabled fluffy block support in node initial configuration.
Implemented get_testnet function in cryptonote_core.
Made it so that fluffy blocks only run on testnet.
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 | 14 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/cryptonote_core/cryptonote_core.cpp b/src/cryptonote_core/cryptonote_core.cpp index 95c49f627..9deb8863d 100644 --- a/src/cryptonote_core/cryptonote_core.cpp +++ b/src/cryptonote_core/cryptonote_core.cpp @@ -915,6 +915,11 @@ namespace cryptonote m_mempool.get_transactions(txs); return true; } + //----------------------------------------------------------------------------------------------- + bool core::get_pool_transaction(const crypto::hash &id, transaction& tx) const + { + return m_mempool.get_transaction(id, tx); + } //----------------------------------------------------------------------------------------------- bool core::get_pool_transactions_and_spent_keys_info(std::vector<tx_info>& tx_infos, std::vector<spent_key_image_info>& key_image_infos) const { diff --git a/src/cryptonote_core/cryptonote_core.h b/src/cryptonote_core/cryptonote_core.h index a5a97a5ad..5ddab4ed4 100644 --- a/src/cryptonote_core/cryptonote_core.h +++ b/src/cryptonote_core/cryptonote_core.h @@ -379,6 +379,13 @@ namespace cryptonote * @note see tx_memory_pool::get_transactions */ bool get_pool_transactions(std::list<transaction>& txs) const; + + /** + * @copydoc tx_memory_pool::get_transaction + * + * @note see tx_memory_pool::get_transaction + */ + bool get_pool_transaction(const crypto::hash& id, transaction& tx) const; /** * @copydoc tx_memory_pool::get_pool_transactions_and_spent_keys_info @@ -611,6 +618,13 @@ namespace cryptonote * @return the number of blocks to sync in one go */ std::pair<uint64_t, uint64_t> get_coinbase_tx_sum(const uint64_t start_offset, const size_t count); + + /** + * @brief get whether we're on testnet or not + * + * @return are we on testnet? + */ + bool get_testnet() const { return m_testnet; }; private: |