code: function prepareParentsAndLastBall(callbacks){
  	parentComposer.pickParentUnitsAndLastBall(
  		db, 
  		function(err, arrParentUnits, last_stable_mc_ball, last_stable_mc_ball_unit, last_stable_mc_ball_mci){
  			if (err)
  				return callbacks.ifError("unable to find parents: "+err);
  			var objResponse = {
  				parent_units: arrParentUnits,
  				last_stable_mc_ball: last_stable_mc_ball,
  				last_stable_mc_ball_unit: last_stable_mc_ball_unit,
  				last_stable_mc_ball_mci: last_stable_mc_ball_mci
  			};
  	
  			callbacks.ifOk(objResponse);
  		}
  	);
  }
docs: function prepareParentsAndLastBall ( callbacks){ // if (!ValidationUtils.isArrayOfLength(arrWitnesses, constants.COUNT_WITNESSES)){ // 	return callbacks.ifError("wrong number of witnesses"); // } //需要同步统一删除 witnesses; storage.determineIfWitnessAddressDefinitionsHaveReferences(db, arrWitnesses, function(bWithReferences){ if (bWithReferences) return callbacks.ifError("some witnesses have references in their addresses"); parentComposer.pickParentUnitsAndLastBall( db, arrWitnesses, function(err, arrParentUnits, last_stable_mc_ball, last_stable_mc_ball_unit, last_stable_mc_ball_mci){ if (err) return callbacks.ifError("unable to find parents: "+err); var objResponse = { parent_units: arrParentUnits, last_stable_mc_ball: last_stable_mc_ball, last_stable_mc_ball_unit: last_stable_mc_ball_unit, last_stable_mc_ball_mci: last_stable_mc_ball_mci }; storage.findWitnessListUnit(db, arrWitnesses, last_stable_mc_ball_mci, function(witness_list_unit){ if (witness_list_unit) objResponse.witness_list_unit = witness_list_unit; callbacks.ifOk(objResponse); }); } ); }); } pow add