fix(mining): perSecondEarning只在挖矿激活时返回非零值
- GetMiningAccountQuery 检查 config.isActive 状态 - 挖矿未激活时 perSecondEarning 返回 0 - 前端资产页面定时器会因此停止增长 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
b7c8cdd249
commit
dcf413fb72
|
|
@ -51,6 +51,7 @@ export class GetMiningAccountQuery {
|
|||
}
|
||||
|
||||
// 计算每秒收益 = (用户贡献 / 全网贡献) × 每秒分配量
|
||||
// 只有在挖矿系统激活时才返回非零值
|
||||
let perSecondEarning = '0';
|
||||
try {
|
||||
const [config, totalContribution] = await Promise.all([
|
||||
|
|
@ -58,7 +59,8 @@ export class GetMiningAccountQuery {
|
|||
this.accountRepository.getTotalContribution(),
|
||||
]);
|
||||
|
||||
if (config && totalContribution.value.toNumber() > 0) {
|
||||
// 检查挖矿系统是否激活
|
||||
if (config && config.isActive && totalContribution.value.toNumber() > 0) {
|
||||
const userContribution = account.totalContribution.value.toNumber();
|
||||
const secondDistribution = config.secondDistribution.value.toNumber();
|
||||
const ratio = userContribution / totalContribution.value.toNumber();
|
||||
|
|
|
|||
Loading…
Reference in New Issue