Multiple changes for critical update, including random locks and activation at 12800. Test for utxos.

This commit is contained in:
Michael Toutonghi
2018-05-26 04:00:17 -07:00
parent 4a1afe0bc5
commit 74329e19f8
9 changed files with 86 additions and 15 deletions

View File

@@ -1052,11 +1052,20 @@ int64_t komodo_block_unlocktime(uint32_t nHeight)
unlocktime = ASSETCHAINS_TIMEUNLOCKTO;
else
{
unlocktime = komodo_block_prg(nHeight) / (0xffffffffffffffff / ((ASSETCHAINS_TIMEUNLOCKTO - ASSETCHAINS_TIMEUNLOCKFROM) + 1));
// boundary and power of 2 can make it exceed to time by 1
unlocktime = unlocktime + ASSETCHAINS_TIMEUNLOCKFROM;
if (unlocktime > ASSETCHAINS_TIMEUNLOCKTO)
unlocktime--;
if (strcmp(ASSETCHAINS_SYMBOL, "VRSC") != 0 || nHeight >= 12800)
{
unlocktime = komodo_block_prg(nHeight) % (ASSETCHAINS_TIMEUNLOCKTO - ASSETCHAINS_TIMEUNLOCKFROM);
// boundary and power of 2 can make it exceed to time by 1
unlocktime = unlocktime + ASSETCHAINS_TIMEUNLOCKFROM;
}
else
{
unlocktime = komodo_block_prg(nHeight) / (0xffffffffffffffff / ((ASSETCHAINS_TIMEUNLOCKTO - ASSETCHAINS_TIMEUNLOCKFROM) + 1));
// boundary and power of 2 can make it exceed to time by 1
unlocktime = unlocktime + ASSETCHAINS_TIMEUNLOCKFROM;
if (unlocktime > ASSETCHAINS_TIMEUNLOCKTO)
unlocktime--;
}
}
return ((int64_t)unlocktime);
}