Fix halving calculation

This commit is contained in:
fekt
2024-04-15 15:01:39 +00:00
parent 9947c14411
commit 054dcb451b

View File

@@ -321,7 +321,7 @@ void Controller::getInfoThenRefresh(bool force)
bool doUpdate = force || (model->getLatestBlock() != curBlock);
int difficulty = reply["difficulty"].get<json::number_integer_t>();
int num_halvings = 1; // number of halvings that have occured already
int blocks_until_halving = (num_halvings*1680000 + 340000) - curBlock;
int blocks_until_halving = (num_halvings*3500000) - curBlock;
int blocktime = 36;
int halving_days = (blocks_until_halving * blocktime) / (60 * 60 * 24) ;
int longestchain = reply["longestchain"].get<json::number_integer_t>();