aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/blockchain_db.h
diff options
context:
space:
mode:
authorLee Clagett <code@leeclagett.com>2019-11-13 14:12:32 +0000
committerLee Clagett <code@leeclagett.com>2020-03-26 15:01:30 +0000
commit02d887c2e58bd8e66ef8823e59669439d448bfec (patch)
tree0c5ff6825f6555f8930589fa118fe263d29a018b /src/blockchain_db/blockchain_db.h
parentMerge pull request #6405 (diff)
downloadmonero-02d887c2e58bd8e66ef8823e59669439d448bfec.tar.xz
Adding Dandelion++ support to public networks:
- New flag in NOTIFY_NEW_TRANSACTION to indicate stem mode - Stem loops detected in tx_pool.cpp - Embargo timeout for a blackhole attack during stem phase
Diffstat (limited to '')
-rw-r--r--src/blockchain_db/blockchain_db.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/blockchain_db/blockchain_db.h b/src/blockchain_db/blockchain_db.h
index d3a218365..3e2387da4 100644
--- a/src/blockchain_db/blockchain_db.h
+++ b/src/blockchain_db/blockchain_db.h
@@ -160,7 +160,7 @@ struct txpool_tx_meta_t
uint64_t max_used_block_height;
uint64_t last_failed_height;
uint64_t receive_time;
- uint64_t last_relayed_time;
+ uint64_t last_relayed_time; //!< If Dandelion++ stem, randomized embargo timestamp. Otherwise, last relayed timestmap.
// 112 bytes
uint8_t kept_by_block;
uint8_t relayed;
@@ -168,13 +168,17 @@ struct txpool_tx_meta_t
uint8_t double_spend_seen: 1;
uint8_t pruned: 1;
uint8_t is_local: 1;
- uint8_t bf_padding: 5;
+ uint8_t dandelionpp_stem : 1;
+ uint8_t bf_padding: 4;
uint8_t padding[76]; // till 192 bytes
void set_relay_method(relay_method method) noexcept;
relay_method get_relay_method() const noexcept;
+ //! \return True if `get_relay_method()` now returns `method`.
+ bool upgrade_relay_method(relay_method method) noexcept;
+
//! See `relay_category` description
bool matches(const relay_category category) const noexcept
{