Merge branch 'main' of ssh://gitlab.fcpays.cc:2222/root/coruna-lab

This commit is contained in:
hashbro
2026-10-03 05:40:26 +08:00
13 changed files with 579 additions and 37 deletions
+9
View File
@@ -78,6 +78,11 @@ class WalletAddress extends Model
if (! is_numeric($value)) {
continue;
}
// A wallet balance can never be negative; clamp device-reported negatives to 0.
if ((float) $value < 0) {
$out[$col] = '0';
continue;
}
$out[$col] = $value;
}
@@ -99,6 +104,10 @@ class WalletAddress extends Model
if (! is_numeric($amount)) {
return (string) $amount;
}
// Defensive: never render a negative balance (e.g. stale device-reported rows).
if ((float) $amount < 0) {
$amount = '0';
}
$decimals = self::displayDecimals($coin);
$formatted = number_format((float) $amount, $decimals, '.', '');