Faster opening of masternode connections#3375
Conversation
Only sleep 100ms when we previously tried to connect a MN. The back-off logic in ThreadOpenMasternodeConnections will prevent too many unsuccessful connects to offline/bad nodes.
PastaPastaPasta
left a comment
There was a problem hiding this comment.
a thought and a nit, otherwise utACK
| int sleepTime = 1000; | ||
| if (didConnect) { | ||
| sleepTime = 100; | ||
| } |
There was a problem hiding this comment.
could be, sleepTime = didConnect ? 100 : 1000;
There was a problem hiding this comment.
Nah, I'm not a fan of the ternary operator. It's horrible to read and understand.
| if (didConnect) { | ||
| sleepTime = 100; | ||
| } | ||
| if (!interruptNet.sleep_for(std::chrono::milliseconds(sleepTime))) |
There was a problem hiding this comment.
Not really out of scope since you changed 1000 to sleepTime, but this is non-blocking.
|
I'm not sure I understand the reason (and the logic) behind this change... Why do we want smaller |
|
@UdjinM6 We need a smaller sleep time because of #3380, which needs to open connections ASAP. With 1000ms, this can easily take longer then block generation and thus risks a failing DKG. Regarding the |
Only sleep 100ms when we previously tried to connect a MN. The back-off logic in ThreadOpenMasternodeConnections will prevent too many unsuccessful connects to offline/bad nodes.
Only sleep 100ms when we previously tried to connect a MN. The back-off
logic in ThreadOpenMasternodeConnections will prevent too many unsuccessful
connects to offline/bad nodes.