cryptonote_protocol: misc fluffy block fixes

- fix wrong block being used when a new block is received between
  a node elaying a fluffy block and sending a new fluffy block
  with txes a peer did not have
- misc a neverending ping pong requesting the same missing txids
  when a new block is received in the meantime, causing the top
  block to not be the one we need
- send the original fluffy block message block height when sending
  a new fluffy block, not the current top height, which might
  have been updated since
- avoid sending back the whole block blob when asking for txes,
  send only the hash instead
- plus misc cleanup and additional debugging logs
This commit is contained in:
moneromooo-monero 2017-02-11 19:38:18 +00:00
parent cb54eeaa31
commit 9faef1f83a
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
4 changed files with 82 additions and 42 deletions

View file

@ -257,16 +257,16 @@ namespace cryptonote
struct request
{
block_complete_entry b;
crypto::hash block_hash;
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)
KV_SERIALIZE_VAL_POD_AS_BLOB(block_hash)
KV_SERIALIZE(current_blockchain_height)
KV_SERIALIZE_CONTAINER_POD_AS_BLOB(missing_tx_indices)
KV_SERIALIZE(hop)
END_KV_SERIALIZE_MAP()
};
};