@ -8243,35 +8243,35 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
state . fShouldBan = false ;
}
komodo_nSPV ( pto ) ;
if ( KOMODO_NSPV ! = 0 )
return ( true ) ;
BOOST_FOREACH ( const CBlockReject & reject , state . rejects )
pto - > PushMessage ( " reject " , ( string ) " block " , reject . chRejectCode , reject . strRejectReason , reject . hashBlock ) ;
state . rejects . clear ( ) ;
// Start block sync
if ( pindexBestHeader = = NULL )
pindexBestHeader = chainActive . Tip ( ) ;
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.
if ( ! state . fSyncStarted & & ! pto - > fClient & & ! fImporting & & ! fReindex & & pindexBestHeader ! = 0 ) {
// Only actively request headers from a single peer, unless we're close to today.
if ( ( nSyncStarted = = 0 & & fFetch ) | | pindexBestHeader - > GetBlockTime ( ) > GetAdjustedTime ( ) - 24 * 60 * 60 ) {
state . fSyncStarted = true ;
nSyncStarted + + ;
CBlockIndex * pindexStart = pindexBestHeader - > pprev ? pindexBestHeader - > pprev : pindexBestHeader ;
LogPrint ( " net " , " initial getheaders (%d) to peer=%d (startheight:%d) \n " , pindexStart - > GetHeight ( ) , pto - > id , pto - > nStartingHeight ) ;
pto - > PushMessage ( " getheaders " , chainActive . GetLocator ( pindexStart ) , uint256 ( ) ) ;
}
}
// Resend wallet transactions that haven't gotten in a block yet
// Except during reindex, importing and IBD, when old wallet
// transactions become unconfirmed and spams other nodes.
if ( ! fReindex & & ! fImporting & & ! IsInitialBlockDownload ( ) )
if ( KOMODO_NSPV = = 0 )
{
GetMainSignals ( ) . Broadcast ( nTimeBestReceived ) ;
BOOST_FOREACH ( const CBlockReject & reject , state . rejects )
pto - > PushMessage ( " reject " , ( string ) " block " , reject . chRejectCode , reject . strRejectReason , reject . hashBlock ) ;
state . rejects . clear ( ) ;
// Start block sync
if ( pindexBestHeader = = NULL )
pindexBestHeader = chainActive . Tip ( ) ;
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.
if ( ! state . fSyncStarted & & ! pto - > fClient & & ! fImporting & & ! fReindex & & pindexBestHeader ! = 0 ) {
// Only actively request headers from a single peer, unless we're close to today.
if ( ( nSyncStarted = = 0 & & fFetch ) | | pindexBestHeader - > GetBlockTime ( ) > GetAdjustedTime ( ) - 24 * 60 * 60 ) {
state . fSyncStarted = true ;
nSyncStarted + + ;
CBlockIndex * pindexStart = pindexBestHeader - > pprev ? pindexBestHeader - > pprev : pindexBestHeader ;
LogPrint ( " net " , " initial getheaders (%d) to peer=%d (startheight:%d) \n " , pindexStart - > GetHeight ( ) , pto - > id , pto - > nStartingHeight ) ;
pto - > PushMessage ( " getheaders " , chainActive . GetLocator ( pindexStart ) , uint256 ( ) ) ;
}
}
// Resend wallet transactions that haven't gotten in a block yet
// Except during reindex, importing and IBD, when old wallet
// transactions become unconfirmed and spams other nodes.
if ( ! fReindex & & ! fImporting & & ! IsInitialBlockDownload ( ) )
{
GetMainSignals ( ) . Broadcast ( nTimeBestReceived ) ;
}
}
//
// Message: inventory
//
@ -8319,7 +8319,8 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
}
if ( ! vInv . empty ( ) )
pto - > PushMessage ( " inv " , vInv ) ;
if ( KOMODO_NSPV ! = 0 )
return ( true ) ;
// Detect whether we're stalling
int64_t nNow = GetTimeMicros ( ) ;
if ( ! pto - > fDisconnect & & state . nStallingSince & & state . nStallingSince < nNow - 1000000 * BLOCK_STALLING_TIMEOUT ) {