Description
The isRetryableImportError function in pkg/crosschain/transfer.go uses string matching to classify errors as retryable. The pattern "insufficient funds" could match both transient UTXO propagation issues and permanent balance insufficiency.
Current behavior
retryablePatterns := []string{
"not found",
"no utxos",
"insufficient funds", // May occur if UTXOs haven't propagated
"missing utxo",
}
If a user truly has insufficient funds, the CLI retries multiple times before failing, wasting time.
Suggested improvements
- Check for specific SDK error types instead of string matching
- Add max retry duration in addition to max attempts
- Log each retry attempt so users understand what's happening
- Consider distinguishing between "no UTXOs at all" (permanent) vs "UTXOs not yet visible" (transient)
Files affected
pkg/crosschain/transfer.go:164-182
Severity
Minor - causes delayed error reporting, not incorrect behavior
Source
Production readiness audit (2026-02-09)
Description
The
isRetryableImportErrorfunction inpkg/crosschain/transfer.gouses string matching to classify errors as retryable. The pattern"insufficient funds"could match both transient UTXO propagation issues and permanent balance insufficiency.Current behavior
If a user truly has insufficient funds, the CLI retries multiple times before failing, wasting time.
Suggested improvements
Files affected
pkg/crosschain/transfer.go:164-182Severity
Minor - causes delayed error reporting, not incorrect behavior
Source
Production readiness audit (2026-02-09)