NodeCache Improvemets

The current patch tries to improve the NodeCache implementation. I strengthened the preconditions of the addNode() function. It will now assert if a null address is added to the cache. The function should be used to add or update a complete NodeInfo struct. If one just wants to update the NodeAvailability of a node, then one should use the updateNode() function, which takes just NodeAddress and NodeAvailability as parameters.

I used the occasion to also enable reading and writing of the X-Try / X-Try-Ultrapeers headers during handshaking. I had turned that off last time I modified the handshaking code. I also made sure that the handshaking code only adds non-null addresses in the node cache.

Regarding the sometimes duplicated connections to the same host, I think I found the cause in ConnectionKeeper. If we have very little nodes in NodeCache, then we not only try nodes with UnknownAvailability, but also nodes with NodeBusy or NodeAvailable.

Committed in revision 14.

Attached Files:

Would you like to post a relpy?


This post starts a thread.
No follow-ups yet.