We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
something like that
receipt, err := client.TransactionReceipt(ctx, txHash) if err == ethereum.NotFound { log.Println("Transaction not found yet. Retrying...") time.Sleep(pollingInterval) continue } else if err != nil { log.Fatalf("Failed to get transaction receipt: %v", err) } // 获取最新的区块号 header, err := client.HeaderByNumber(ctx, nil) if err != nil { log.Fatalf("Failed to get latest block: %v", err) } // 计算确认数量 confirmations := new(big.Int).Sub(header.Number, receipt.BlockNumber).Uint64() if confirmations >= confirmationsRequired { fmt.Printf("Transaction has been confirmed with %d confirmations.\n", confirmations) break } else { fmt.Printf("Transaction has %d confirmations; waiting for %d more confirmations...\n", confirmations, confirmationsRequired-confirmations) time.Sleep(pollingInterval) } ```
The text was updated successfully, but these errors were encountered:
Ravenyjh
No branches or pull requests
something like that
The text was updated successfully, but these errors were encountered: