@@ -955,6 +955,7 @@ void PeerLogicValidation::UpdatedBlockTip(const CBlockIndex *pindexNew, const CB
955955 }
956956 // Relay inventory, but don't relay old inventory during initial block download.
957957 connman->ForEachNode ([nNewHeight, &vHashes](CNode* pnode) {
958+ if (pnode->fMasternode ) return ;
958959 if (nNewHeight > (pnode->nStartingHeight != -1 ? pnode->nStartingHeight - 2000 : 0 )) {
959960 for (const uint256& hash : reverse_iterate (vHashes)) {
960961 pnode->PushBlockHash (hash);
@@ -1875,6 +1876,14 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
18751876 vRecv >> fOtherMasternode ;
18761877 if (pfrom->fInbound ) {
18771878 pfrom->fMasternode = fOtherMasternode ;
1879+ if (fOtherMasternode ) {
1880+ LogPrint (BCLog::NET, " peer=%d is an inbound masternode connection, not relaying anything to it\n " , pfrom->GetId ());
1881+ if (!fMasternodeMode ) {
1882+ LogPrint (BCLog::NET, " but we're not a masternode, disconnecting\n " );
1883+ pfrom->fDisconnect = true ;
1884+ return true ;
1885+ }
1886+ }
18781887 }
18791888 }
18801889 // Disconnect if we connected to ourself
@@ -2316,7 +2325,9 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
23162325 LogPrint (BCLog::NET, " getblocks stopping, pruned or too old block at %d %s\n " , pindex->nHeight , pindex->GetBlockHash ().ToString ());
23172326 break ;
23182327 }
2319- pfrom->PushInventory (CInv (MSG_BLOCK, pindex->GetBlockHash ()));
2328+ if (!pfrom->fMasternode ) {
2329+ pfrom->PushInventory (CInv (MSG_BLOCK, pindex->GetBlockHash ()));
2330+ }
23202331 if (--nLimit <= 0 )
23212332 {
23222333 // When this block is requested, we'll send an inv that'll
@@ -3613,7 +3624,7 @@ bool PeerLogicValidation::SendMessages(CNode* pto, std::atomic<bool>& interruptM
36133624 if (pindexBestHeader == nullptr )
36143625 pindexBestHeader = chainActive.Tip ();
36153626 bool fFetch = state.fPreferredDownload || (nPreferredDownload == 0 && !pto->fClient && !pto->fOneShot ); // Download if this is a nice peer, or we have no nice peers and this one might do.
3616- if (!state.fSyncStarted && !pto->fClient && !fImporting && !fReindex ) {
3627+ if (!state.fSyncStarted && !pto->fClient && !fImporting && !fReindex && !pto-> fMasternode ) {
36173628 // Only actively request headers from a single peer, unless we're close to end of initial download.
36183629 if ((nSyncStarted == 0 && fFetch ) || pindexBestHeader->GetBlockTime () > GetAdjustedTime () - nMaxTipAge) {
36193630 state.fSyncStarted = true ;
0 commit comments