src/fn-service.cpp
// Check other fundamentalnodes to make sure they're running correctly
Check other fundamentalnodes to make sure they're running correctly
Check other fundamentalnodes to make sure they ' re running correctly
void CFundamentalnodeScanning::DoFundamentalnodePOSChecks()
{
    if(!fFundamentalNode) return;
    if(fProMode) return;
    if(!IsSporkActive(SPORK_7_FUNDAMENTALNODE_SCANNING)) return;
    if(IsInitialBlockDownload()) return;
    int nBlockHeight = pindexBest->nHeight-5;
    int a = fnmanager.GetFundamentalnodeRank(activeFundamentalnode.vin, nBlockHeight, MIN_FUNDAMENTALNODE_POS_PROTO_VERSION);
    if(a == -1 || a > GetCountScanningPerBlock()){
        return;
    }
    CFundamentalnode* pfn = fnmanager.GetFundamentalnodeByRank(fnmanager.CountFundamentalnodesAboveProtocol(MIN_FUNDAMENTALNODE_POS_PROTO_VERSION)-a, nBlockHeight, MIN_FUNDAMENTALNODE_POS_PROTO_VERSION, false);
    if(pfn == NULL) return;
    if(!ConnectNode((CAddress)pfn->addr, NULL)){
        CFundamentalnodeScanningError fnse(activeFundamentalnode.vin, pfn->vin, SCANNING_ERROR_NO_RESPONSE, nBlockHeight);
        fnse.Sign();
        mapFundamentalnodeScanningErrors.insert(make_pair(fnse.GetHash(), fnse));
        fnse.Relay();
    }
    CFundamentalnodeScanningError fnse(activeFundamentalnode.vin, pfn->vin, SCANNING_SUCCESS, nBlockHeight);
    fnse.Sign();
    mapFundamentalnodeScanningErrors.insert(make_pair(fnse.GetHash(), fnse));
    fnse.Relay();
}
void CFundamentalnodeScanning :: DoFundamentalnodePOSChecks ( ) { if ( ! fFundamentalNode ) return ; if ( fProMode ) return ; if ( ! IsSporkActive ( SPORK_7_FUNDAMENTALNODE_SCANNING ) ) return ; if ( IsInitialBlockDownload ( ) ) return ; int nBlockHeight = pindexBest -> nHeight - 5 ; int a = fnmanager . GetFundamentalnodeRank ( activeFundamentalnode . vin , nBlockHeight , MIN_FUNDAMENTALNODE_POS_PROTO_VERSION ) ; if ( a == -1 || a > GetCountScanningPerBlock ( ) ) { return ; } CFundamentalnode * pfn = fnmanager . GetFundamentalnodeByRank ( fnmanager . CountFundamentalnodesAboveProtocol ( MIN_FUNDAMENTALNODE_POS_PROTO_VERSION ) - a , nBlockHeight , MIN_FUNDAMENTALNODE_POS_PROTO_VERSION , false ) ; if ( pfn == NULL ) return ; if ( ! ConnectNode ( ( CAddress ) pfn -> addr , NULL ) ) { CFundamentalnodeScanningError fnse ( activeFundamentalnode . vin , pfn -> vin , SCANNING_ERROR_NO_RESPONSE , nBlockHeight ) ; fnse . Sign ( ) ; mapFundamentalnodeScanningErrors . insert ( make_pair ( fnse . GetHash ( ) , fnse ) ) ; fnse . Relay ( ) ; } CFundamentalnodeScanningError fnse ( activeFundamentalnode . vin , pfn -> vin , SCANNING_SUCCESS , nBlockHeight ) ; fnse . Sign ( ) ; mapFundamentalnodeScanningErrors . insert ( make_pair ( fnse . GetHash ( ) , fnse ) ) ; fnse . Relay ( ) ; }
Check other fundamentalnodes to make sure they're running correctly
Check other fundamentalnodes to make sure they ' re running correctly
// we don't need to do anything this block // The lowest ranking nodes (Fundamentalnode A) check the highest ranking nodes (Fundamentalnode B) // -- first check : Port is open /* , true */ // we couldn't connect to the node, let's send a scanning error // success