Amoveo ♥🧿
This node is not up to date. Please use a light wallet that is using up to date software
difficulty_should_be2(Header) ->This is the part of the code we need to change.
F = constants:retarget_frequency() div 2,
{Times1, Hash2000} = retarget(Header, F, []),
{Times2, _} = retarget(Hash2000, F, []),
M1 = median(Times1),
M2 = median(Times2),
Tbig = M1 - M2,
T0 = Tbig div F,%T is the estimated block time over last 2000 blocks.
T1 = max(1, T0),
T = min(T1, Header#header.period * 7 div 6),
NT = pow:recalculate(Hash2000#header.difficulty,
Header#header.period,
T),
max(NT, constants:initial_difficulty()).
retarget(Header, 1, L) -> {L, Header};
retarget(Header, N, L) ->
{ok, PH} = read(Header#header.prev_hash),
T = PH#header.time,
retarget(PH, N-1, [T|L]).
median(L) ->
S = length(L),
F = fun(A, B) -> A > B end,
Sorted = lists:sort(F, L),
lists:nth(S div 2, Sorted).
difficulty_should_be2(Header) ->
P = Header#header.period,
T = Header#header.time,
{ok, PH} = read(Header#header.prev_hash),
DT = T - PH#header.time,
true = DT > 0,
SDT = (DT + (19 * P)) div 20,
ND = pow:recalculate(Header#header.difficulty,
P,
SDT),
max(NT, constants:initial_difficulty()).
git pull
then turn it on.
make killall
make prod-restart
make prod-clean
after make killall
then make prod-restart
git clone https://github.com/zack-bitcoin/amoveo
sudo apt update; sudo apt upgrade