You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is code in "updateStableMcFlag" function of main_chain.js to find min witnessed level.
If free main chain unit and last stable unit has different witness list, for example, there is one witness different. From free main chain unit to unit whose level large than witnessed_level of free main chain unit along main chain, there may be only 6 witnesses are in witness list of last stable unit.
conn.query("SELECT witnessed_level FROM units WHERE is_free=1 AND is_on_main_chain=1", function(wl_rows)
{
if (wl_rows.length !== 1)
throw Error("not a single mc wl");
// this is the level when we colect 7 witnesses if walking up the MC from its end
var mc_end_witnessed_level = wl_rows[0].witnessed_level;
conn.query(
// among these 7 witnesses, find min wl
"SELECT MIN(witnessed_level) AS min_mc_wl FROM units LEFT JOIN unit_authors USING(unit) \n\
WHERE is_on_main_chain=1 AND level>=? AND address IN(?)", // _left_ join enforces the best query plan in sqlite
[mc_end_witnessed_level, arrWitnesses],
function(min_wl_rows){
if (min_wl_rows.length !== 1)
throw Error("not a single min mc wl");
var min_mc_wl = min_wl_rows[0].min_mc_wl;
...
The text was updated successfully, but these errors were encountered:
Below is code in "updateStableMcFlag" function of main_chain.js to find min witnessed level.
If free main chain unit and last stable unit has different witness list, for example, there is one witness different. From free main chain unit to unit whose level large than witnessed_level of free main chain unit along main chain, there may be only 6 witnesses are in witness list of last stable unit.
The text was updated successfully, but these errors were encountered: