main_chain.js
function propagateFinalBad(arrFinalBadUnits, onPropagated){
		if (arrFinalBadUnits.length === 0)
			return onPropagated();
		conn.query("SELECT DISTINCT unit FROM inputs WHERE src_unit IN(?)", [arrFinalBadUnits], function(rows){
			if (rows.length === 0)
				return onPropagated();
			var arrSpendingUnits = rows.map(function(row){ return row.unit; });
			conn.query("UPDATE units SET sequence='final-bad' WHERE unit IN(?)", [arrSpendingUnits], function(){
				arrSpendingUnits.forEach(function(unit){
					storage.assocUnstableUnits[unit].sequence = 'final-bad';
				});
				propagateFinalBad(arrSpendingUnits, onPropagated);
			});
		});
	}
function propagateFinalBad(arrFinalBadUnits, onPropagated){
		if (arrFinalBadUnits.length === 0)
			return onPropagated();
		conn.query("SELECT DISTINCT unit FROM inputs WHERE src_unit IN(?)", [arrFinalBadUnits], function(rows){
			if (rows.length === 0)
				return onPropagated();
			var arrSpendingUnits = rows.map(function(row){ return row.unit; });
			conn.query("UPDATE units SET sequence='final-bad' WHERE unit IN(?)", [arrSpendingUnits], function(){
				arrSpendingUnits.forEach(function(unit){
					storage.assocUnstableUnits[unit].sequence = 'final-bad';
				});
				propagateFinalBad(arrSpendingUnits, onPropagated);
			});
		});
	}
function propagateFinalBad ( arrFinalBadUnits , onPropagated ) { if ( arrFinalBadUnits . length === 0 ) return onPropagated ( ) ; conn . query ( "SELECT DISTINCT unit FROM inputs WHERE src_unit IN(?)" , [ arrFinalBadUnits ] , function ( rows ) { if ( rows . length === 0 ) return onPropagated ( ) ; var arrSpendingUnits = rows . map ( function ( row ) { return row . unit ; } ) ; conn . query ( "UPDATE units SET sequence='final-bad' WHERE unit IN(?)" , [ arrSpendingUnits ] , function ( ) { arrSpendingUnits . forEach ( function ( unit ) { storage . assocUnstableUnits [ unit ] . sequence = 'final-bad' ; } ) ; propagateFinalBad ( arrSpendingUnits , onPropagated ) ; } ) ; } ) ; }
all future units that spent these unconfirmed units become final-bad too
all future units that spent these unconfirmed units become final - bad too