Skip to content

Commit

Permalink
Remove unavailable item from active sync requests
Browse files Browse the repository at this point in the history
When got an `item_not_available_message` from a peer, the item was
removed from the `sync_items_requested_from_peer` list of the peer,
but it was left in the `_active_sync_requests` list.
When disconnecting from the peer, since the
`sync_items_requested_from_peer` list of the peer no longer contains
the item, the cleanup process does not remove it from the
`_active_sync_requests` list either.
As a result, the node will not request the item from another peer,
thus gets stuck.
  • Loading branch information
abitmore committed May 3, 2021
1 parent 6cd73b8 commit 1340df1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions libraries/net/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2359,6 +2359,7 @@ namespace graphene { namespace net { namespace detail {
auto sync_item_iter = originating_peer->sync_items_requested_from_peer.find(requested_item.item_hash);
if (sync_item_iter != originating_peer->sync_items_requested_from_peer.end())
{
_active_sync_requests.erase(*sync_item_iter);
originating_peer->sync_items_requested_from_peer.erase(sync_item_iter);

if (originating_peer->peer_needs_sync_items_from_us)
Expand Down

0 comments on commit 1340df1

Please sign in to comment.