dcrdex
dcrdex copied to clipboard
dcr: spv will panic on retry in spv loop.
trafficstars
Here: https://github.com/decred/dcrdex/blob/1ecfbc03e2c5d1359b5d51b32650e6cbff29b6b0/client/asset/dcr/spv.go#L430-L443
This was recently found while developing libwallet for cake, if the error has nothing to do with the context, this will panic on the second try of syncer.Run with closing a closed channel when close(s.initialSyncDone) happens for a second time. Unsure if intended on the dcrwallet side but doesn't seem to come up much anyway. The fix for libwallet is to recreate the syncer on every try. https://github.com/decred/libwallet/pull/18
Wow, actually hit this today on mainnet. Maybe it's due to some recent change:
2025-03-18 02:04:43.594 [INF] CORE: notify: |SUCCESS| (walletconfig) Wallet connectivity restored - Decred wallet has reestablished connectivity.
panic: close of closed channel
goroutine 19964016 [running]:
decred.org/dcrwallet/v4/spv.(*Syncer).Run.func12()
/home/joe/go/pkg/mod/decred.org/dcrwallet/[email protected]/spv/sync.go:453 +0x2f8
golang.org/x/sync/errgroup.(*Group).Go.func1()
/home/joe/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:78 +0x54
created by golang.org/x/sync/errgroup.(*Group).Go in goroutine 289
/home/joe/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x98