fix(blockchain): fix deposit stuck in CONFIRMING status
The updateConfirmations logic only checked for DETECTED status when confirming, so deposits that transitioned to CONFIRMING would never be confirmed even with enough confirmations. Changed condition to accept both DETECTED and CONFIRMING status. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5e670e64b3
commit
db3e0ba1bd
|
|
@ -161,12 +161,14 @@ export class DepositTransaction extends AggregateRoot<bigint> {
|
|||
const confirmations = Number(currentBlockNumber.diff(this.props.blockNumber));
|
||||
this.props.confirmations = Math.max(0, confirmations);
|
||||
|
||||
// 检查是否达到确认要求(状态为 DETECTED 或 CONFIRMING 都可以确认)
|
||||
if (
|
||||
this.props.confirmations >= requiredConfirmations &&
|
||||
this.props.status === DepositStatus.DETECTED
|
||||
(this.props.status === DepositStatus.DETECTED || this.props.status === DepositStatus.CONFIRMING)
|
||||
) {
|
||||
this.confirm();
|
||||
} else if (this.props.status === DepositStatus.DETECTED) {
|
||||
// 首次检测但确认数不够,标记为确认中
|
||||
this.props.status = DepositStatus.CONFIRMING;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue