mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
The inner loop in refreshWallets drops cached wallets that sort before
the next enumerated device or that have failed. When this drop-while
logic was refactored into an early break, the condition was negated but
the boolean operator was left as ||, so the negation is incomplete.
The drop condition is:
(URL.Cmp(url) < 0) || (failure != nil)
so the break (abort dropping) condition must be its De Morgan negation:
(URL.Cmp(url) >= 0) && (failure == nil)
With ||, the loop breaks as soon as the front wallet is operational,
even when it sorts before the current device. The stale wallet is not
dropped in place, and neither the "wrap new wallet" nor the "keep
matching wallet" branch matches, so the still-present device is silently
skipped for that refresh cycle (no WalletArrived) and is only re-added
on a later refresh.
Switch the operator to && so the break condition correctly mirrors the
intended drop semantics.
|
||
|---|---|---|
| .. | ||
| trezor | ||
| hub.go | ||
| ledger.go | ||
| trezor.go | ||
| wallet.go | ||