File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 2323#include " primitives/transaction.h"
2424#include " scheduler.h"
2525#include " tiertwo/net_masternodes.h"
26+ #include " tiertwo/tiertwo_sync_state.h"
2627#include " validation.h"
2728
2829#ifdef WIN32
@@ -1111,6 +1112,13 @@ void CConnman::AcceptConnection(const ListenSocket& hListenSocket) {
11111112 return ;
11121113 }
11131114
1115+ // if we are a MN, don't accept incoming connections until fully synced
1116+ if (fMasterNode && !g_tiertwo_sync_state.IsSynced ()) {
1117+ LogPrint (BCLog::NET, " AcceptConnection -- masternode is not synced yet, skipping inbound connection attempt\n " );
1118+ CloseSocket (hSocket);
1119+ return ;
1120+ }
1121+
11141122 // TODO: pending review.
11151123 // Evict connections until we are below nMaxInbound. In case eviction protection resulted in nodes to not be evicted
11161124 // before, they might get evicted in batches now (after the protection timeout).
You can’t perform that action at this time.
0 commit comments