Fix self connectivity checking on CActiveMasternode::ManageState()#1863
Fix self connectivity checking on CActiveMasternode::ManageState()#1863thelazier wants to merge 1 commit intodashpay:developfrom thelazier:develop_fix_mn_selfcheck
Conversation
UdjinM6
left a comment
There was a problem hiding this comment.
Nice find! 👍
Can confirm the issue, however not 100% happy with the solution, see below.
| CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCountFailure) | ||
| { | ||
| if (pszDest == NULL) { | ||
| if (IsLocal(addrConnect)) |
There was a problem hiding this comment.
This changes behavior for "normal" nodes too, should probably avoid that. I think passing and optional param (default to false) fConnectToMasternode to CConnman::ConnectNode and using it here would be a better solution.
|
What about an alternative solution where ManageStateInitial calls OpenNetworkConnection directly with pszDest set to the string version of the address and fFeeler being true? IMHO, using the CConnman for this at all has a bad taste. We want to only check if the port is accessible if I understand this correctly, so we should probably have a helper function that only does a call to ConnectSocket and immediately closes the socket again. |
|
Agree, having a special helper would probably be an even better way. |
|
Agree with @codablock |
No description provided.