Closed l0k18 closed 3 years ago
Just copy IPs into map and then back into a fresh slice to jumble them up. Code was already in place to try them in given order. Perhaps even better, change the IPs field to a map since gotiny makes typing simple.
better, change the IPs to an empty struct map, then the keys are the addresses, they need to be strings for dial anyway, with port attached.
just occurs that maybe all paths will be attempted. This is probably not desirable, though the p2p system has self-connection identification via the nonces, perhaps it also knows not to connect to the same nonced peer? Reaching?
seems to now create n+1 connections to peers with multiple paths, there is a circular logic to fixing it to only do it same as connections, going to leave it for now since it doesn't hurt.
miner work delivery is working again, also follows the same paths. Still some issues with wallet sync to the chain but now can move on to getting transactions properly encoded in the job messages
Increasingly, users have more than one network attached to a device. Some of these different connections have connectivity that may allow multiple paths to operate. Trying them one at a time and leaving it at that might work, though it might be better if it selects them randomly, and it may be better again if it tries all of them and sends out on every one of them.
Probably for now this will just be a shuffle, and accept the first one working, as this is simple and effective.