code: function(objJoint, cb2){
  							var objUnit = objJoint.unit;
  							var unit = objUnit.unit;
  							// assocProvenUnitsNonserialness[unit] is true for non-serials, false for serials, undefined for unstable
  							var sequence = assocProvenUnitsNonserialness[unit] ? 'final-bad' : 'good';
  							if (unit in assocProvenUnitsNonserialness)
  								arrProvenUnits.push(unit);
  							if (assocExistingUnits[unit]){
  								//if (!assocProvenUnitsNonserialness[objUnit.unit]) // not stable yet
  								//    return cb2();
  								// it can be null!
  								//if (!ValidationUtils.isNonnegativeInteger(objUnit.main_chain_index))
  								//    return cb2("bad main_chain_index in proven unit");
  								db.query(
  									"UPDATE units SET main_chain_index=?, sequence=? WHERE unit=?", 
  									[objUnit.main_chain_index, sequence, unit], 
  									function(){
  										if (sequence === 'good')
  											return cb2();
  										// void the final-bad
  										breadcrumbs.add('will void '+unit);
  										db.executeInTransaction(function doWork(conn, cb3){
  											var arrQueries = [];
  											archiving.generateQueriesToArchiveJoint(conn, objJoint, 'voided', arrQueries, function(){
  												async.series(arrQueries, cb3);
  											});
  										}, cb2);
  									}
  								);
  							}
  							else{
  								arrNewUnits.push(unit);
  								writer.saveJoint(objJoint, {sequence: sequence, arrDoubleSpendInputs: [], arrAdditionalQueries: []}, null, cb2);
  							}
  						}
docs: have them in forward chronological order so that we correctly mark is_spent flag