go-ethereum/accounts
cuiweixie be254ccb19 accounts/usbwallet: fix De Morgan error dropping stale wallets on refresh
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.
2026-06-11 20:00:00 +08:00
..
abi accounts/abi, core, metrics, miner, rlp, signer, triedb: fix all incorrect variable usages in error strings (#35121) 2026-06-08 12:39:10 +02:00
external all: implement eip-7702 set code tx (#30078) 2024-12-16 11:29:37 +01:00
keystore accounts/keystore: enable fsnotify watcher on linux/arm64 (#34834) 2026-04-28 15:36:01 +02:00
scwallet accounts/scwallet: truncate before write (#34815) 2026-04-27 16:13:42 +02:00
usbwallet accounts/usbwallet: fix De Morgan error dropping stale wallets on refresh 2026-06-11 20:00:00 +08:00
accounts.go crypto/keccak: vendor in golang.org/x/crypto/sha3 (#33323) 2026-02-03 14:55:27 -07:00
accounts_test.go accounts: run tests in parallel (#28544) 2023-12-04 14:55:06 +01:00
errors.go accounts: fix typo in comments (#24805) 2022-05-03 08:49:41 +02:00
hd.go build: upgrade to go 1.19 (#25726) 2022-09-10 13:25:40 +02:00
hd_test.go accounts: run tests in parallel (#28544) 2023-12-04 14:55:06 +01:00
manager.go accounts: fix data race when closing manager (#31982) 2025-06-17 14:44:51 +02:00
sort.go accounts, console: frendly card errors, support pin unblock 2019-04-08 13:19:37 +02:00
url.go build: upgrade to go 1.19 (#25726) 2022-09-10 13:25:40 +02:00
url_test.go accounts: run tests in parallel (#28544) 2023-12-04 14:55:06 +01:00