Instead of literally asking to a node all values for givent `h`, we first ask
for all ids the node has. Then, we concurently and individually ask for each
values that match each id we recovered in our first request.
Since bootstrapSearch was rewritten to use the node cache, it made it clear that
refill should be rewritten as such. However, then bootstrapSearch becomes
irrelevant.
An enhancement to refill is that it will let insertNode review its whole list
of nodes and then let it insert nodes up to SEARCH_NODES nodes. The previous
method would not garantee this behavior since, most of the times, it would pass
less than SEARCH_NODES nodes to insertNode.
The number of currently requested nodes, formerly named currentGetRequests, was
renamed since it was not accurately describing the behavior. The number we are
counting is not the number of 'get' requests, but rather the number of nodes
being requested simultaneously.
Since the elements inside are going to be moved constantly during the life of
the node, this design is better. Also, it works around a crash when the store is
resized (elements inside moved) at some point (always happenned the 3rd time)
for some reason. This bug was known when compiled with LLVM >7.3.0 (>clang-703.0.31).
If operator bool is not marked as explicit and you try to do such:
a == b
where a and b are instances of class with overloaded bool operator,
the behavior is not the waited one: a and b are casted to bool
BEFORE the comparaison! This could lead into non waited situation.
This patch fixes all operator bool() where overloaded.
This also implements PublicKey operators == and != as needed in value.h.
This last showed a typical case explained upper.
Signed-off-by: Guillaume Roguez <guillaume.roguez@savoirfairelinux.com>