Skip to content

Commit

Permalink
bugfix explorer & CoinsUpdater()
Browse files Browse the repository at this point in the history
  • Loading branch information
tpfue committed Apr 4, 2024
1 parent 9c44b77 commit 3734f7b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions web/yaamp/core/backend/coins.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function BackendCoinsUpdate()
// debuglog("doing $coin->name");

$remote = new WalletRPC($coin);
if(!$remote) continue;

$info = $remote->getinfo();
if(!$info && $coin->enable)
Expand Down Expand Up @@ -308,6 +309,8 @@ function BackendCoinsUpdate()
$coin->actual_ttf = percent_feedback($coin->actual_ttf, $ttf, 5);
$coin->last_network_found = time();
}

$coin->block_height = $info['blocks'];
}
else {
debuglog($coin->symbol." wallet is missing blocks in info-array");
Expand Down
9 changes: 7 additions & 2 deletions web/yaamp/modules/explorer/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,13 @@ function wallet_peers(id)
if ($remote)
$info = $remote->getmininginfo();
if (isset($info['networkhashps'])) {
$coin->network_hash = $info['networkhashps'];
controller()->memcache->set("yiimp-nethashrate-{$coin->symbol}", $info['networkhashps'], 60);
if (is_array($info['networkhashps'])) {
if (isset($info['networkhashps'][$coin->algo])) {
$coin->network_hash = $info['networkhashps'][$coin->algo];
}
}
else $coin->network_hash = $info['networkhashps'];
controller()->memcache->set("yiimp-nethashrate-{$coin->symbol}", $coin->network_hash, 60);
}
else if (isset($info['netmhashps'])) {
$coin->network_hash = floatval($info['netmhashps']) * 1e6;
Expand Down

0 comments on commit 3734f7b

Please sign in to comment.