mc/byzantine.js
function gossipLastMessageAtFixedInterval(){
    if(p_phase_timeout >0 && Date.now() - p_phase_timeout > constants.BYZANTINE_PHASE_TIMEOUT){

        if(bByzantineUnderWay && last_prevote_gossip &&
            typeof last_prevote_gossip !== 'undefined' &&
            Object.keys(last_prevote_gossip).length > 0){
            if(last_prevote_gossip.type === constants.BYZANTINE_PREVOTE && h_p === last_prevote_gossip.h){
                // console.log("byllllogg gossipLastMessageAtFixedInterval broadcastPrevote" + JSON.stringify(last_prevote_gossip));
                broadcastPrevote(last_prevote_gossip.h, last_prevote_gossip.p, last_prevote_gossip.idv);
            }
        }
        if(bByzantineUnderWay && last_precommit_gossip &&
            typeof last_precommit_gossip !== 'undefined' &&
            Object.keys(last_precommit_gossip).length > 0){
            if(last_precommit_gossip.type === constants.BYZANTINE_PRECOMMIT && h_p === last_precommit_gossip.h){
                if(last_precommit_gossip.idv !== null && assocByzantinePhase[last_precommit_gossip.h].phase[last_precommit_gossip.p].proposal
                    && typeof assocByzantinePhase[last_precommit_gossip.h].phase[last_precommit_gossip.p].proposal !== 'undefined'){
                    var lastProposal = assocByzantinePhase[last_precommit_gossip.h].phase[last_precommit_gossip.p].proposal;
                    broadcastProposal(last_precommit_gossip.h, last_precommit_gossip.p, lastProposal, lastProposal.vp);
                }
                // console.log("byllllogg gossipLastMessageAtFixedInterval broadcastPrecommit" + JSON.stringify(last_precommit_gossip));
                broadcastPrecommit(last_precommit_gossip.h, last_precommit_gossip.p, last_precommit_gossip.sig, last_precommit_gossip.idv);
            }        
        }
    }
}
function gossipLastMessageAtFixedInterval(){
    if(p_phase_timeout >0 && Date.now() - p_phase_timeout > constants.BYZANTINE_PHASE_TIMEOUT){

        if(bByzantineUnderWay && last_prevote_gossip &&
            typeof last_prevote_gossip !== 'undefined' &&
            Object.keys(last_prevote_gossip).length > 0){
            if(last_prevote_gossip.type === constants.BYZANTINE_PREVOTE && h_p === last_prevote_gossip.h){
                // console.log("byllllogg gossipLastMessageAtFixedInterval broadcastPrevote" + JSON.stringify(last_prevote_gossip));
                broadcastPrevote(last_prevote_gossip.h, last_prevote_gossip.p, last_prevote_gossip.idv);
            }
        }
        if(bByzantineUnderWay && last_precommit_gossip &&
            typeof last_precommit_gossip !== 'undefined' &&
            Object.keys(last_precommit_gossip).length > 0){
            if(last_precommit_gossip.type === constants.BYZANTINE_PRECOMMIT && h_p === last_precommit_gossip.h){
                if(last_precommit_gossip.idv !== null && assocByzantinePhase[last_precommit_gossip.h].phase[last_precommit_gossip.p].proposal
                    && typeof assocByzantinePhase[last_precommit_gossip.h].phase[last_precommit_gossip.p].proposal !== 'undefined'){
                    var lastProposal = assocByzantinePhase[last_precommit_gossip.h].phase[last_precommit_gossip.p].proposal;
                    broadcastProposal(last_precommit_gossip.h, last_precommit_gossip.p, lastProposal, lastProposal.vp);
                }
                // console.log("byllllogg gossipLastMessageAtFixedInterval broadcastPrecommit" + JSON.stringify(last_precommit_gossip));
                broadcastPrecommit(last_precommit_gossip.h, last_precommit_gossip.p, last_precommit_gossip.sig, last_precommit_gossip.idv);
            }        
        }
    }
}
function gossipLastMessageAtFixedInterval ( ) { if ( p_phase_timeout > 0 && Date . now ( ) - p_phase_timeout > constants . BYZANTINE_PHASE_TIMEOUT ) { if ( bByzantineUnderWay && last_prevote_gossip && typeof last_prevote_gossip !== 'undefined' && Object . keys ( last_prevote_gossip ) . length > 0 ) { if ( last_prevote_gossip . type === constants . BYZANTINE_PREVOTE && h_p === last_prevote_gossip . h ) { // console.log("byllllogg gossipLastMessageAtFixedInterval broadcastPrevote" + JSON.stringify(last_prevote_gossip)); broadcastPrevote ( last_prevote_gossip . h , last_prevote_gossip . p , last_prevote_gossip . idv ) ; } } if ( bByzantineUnderWay && last_precommit_gossip && typeof last_precommit_gossip !== 'undefined' && Object . keys ( last_precommit_gossip ) . length > 0 ) { if ( last_precommit_gossip . type === constants . BYZANTINE_PRECOMMIT && h_p === last_precommit_gossip . h ) { if ( last_precommit_gossip . idv !== null && assocByzantinePhase [ last_precommit_gossip . h ] . phase [ last_precommit_gossip . p ] . proposal && typeof assocByzantinePhase [ last_precommit_gossip . h ] . phase [ last_precommit_gossip . p ] . proposal !== 'undefined' ) { var lastProposal = assocByzantinePhase [ last_precommit_gossip . h ] . phase [ last_precommit_gossip . p ] . proposal ; broadcastProposal ( last_precommit_gossip . h , last_precommit_gossip . p , lastProposal , lastProposal . vp ) ; } // console.log("byllllogg gossipLastMessageAtFixedInterval broadcastPrecommit" + JSON.stringify(last_precommit_gossip)); broadcastPrecommit ( last_precommit_gossip . h , last_precommit_gossip . p , last_precommit_gossip . sig , last_precommit_gossip . idv ) ; } } } }
private function end Send the last message at fixed intervals
private function end Send the last message at fixed intervals