aboutsummaryrefslogtreecommitdiff
path: root/src/cryptonote_protocol/cryptonote_protocol_defs.h
diff options
context:
space:
mode:
authorDion Ahmetaj <Dion Ahmetaj>2016-10-26 15:00:08 -0400
committerDion Ahmetaj <Dion Ahmetaj>2016-11-09 14:24:27 -0500
commitd61bd8187e170cd4ae56f5047cc172d257c26237 (patch)
treee9812862534eda973c6579a13381f8a0b92504a0 /src/cryptonote_protocol/cryptonote_protocol_defs.h
parentMerge pull request #1272 (diff)
downloadmonero-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_protocol/cryptonote_protocol_defs.h')
-rw-r--r--src/cryptonote_protocol/cryptonote_protocol_defs.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/cryptonote_protocol/cryptonote_protocol_defs.h b/src/cryptonote_protocol/cryptonote_protocol_defs.h
index edcf2af8e..7adc69080 100644
--- a/src/cryptonote_protocol/cryptonote_protocol_defs.h
+++ b/src/cryptonote_protocol/cryptonote_protocol_defs.h
@@ -69,6 +69,8 @@ namespace cryptonote
uint64_t avg_upload;
uint64_t current_upload;
+
+ uint32_t support_flags;
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(incoming)
@@ -87,6 +89,7 @@ namespace cryptonote
KV_SERIALIZE(current_download)
KV_SERIALIZE(avg_upload)
KV_SERIALIZE(current_upload)
+ KV_SERIALIZE(support_flags)
END_KV_SERIALIZE_MAP()
};
@@ -223,5 +226,49 @@ namespace cryptonote
END_KV_SERIALIZE_MAP()
};
};
+
+ /************************************************************************/
+ /* */
+ /************************************************************************/
+ struct NOTIFY_NEW_FLUFFY_BLOCK
+ {
+ const static int ID = BC_COMMANDS_POOL_BASE + 8;
+
+ struct request
+ {
+ block_complete_entry b;
+ uint64_t current_blockchain_height;
+ uint32_t hop;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(b)
+ KV_SERIALIZE(current_blockchain_height)
+ KV_SERIALIZE(hop)
+ END_KV_SERIALIZE_MAP()
+ };
+ };
+
+ /************************************************************************/
+ /* */
+ /************************************************************************/
+ struct NOTIFY_REQUEST_FLUFFY_MISSING_TX
+ {
+ const static int ID = BC_COMMANDS_POOL_BASE + 9;
+ struct request
+ {
+ block_complete_entry b;
+ uint64_t current_blockchain_height;
+ std::vector<size_t> missing_tx_indices;
+ uint32_t hop;
+
+ BEGIN_KV_SERIALIZE_MAP()
+ KV_SERIALIZE(b)
+ KV_SERIALIZE_CONTAINER_POD_AS_BLOB(missing_tx_indices)
+ KV_SERIALIZE(hop)
+ KV_SERIALIZE(current_blockchain_height)
+ END_KV_SERIALIZE_MAP()
+ };
+ };
+
}