dmigwi / sample

0 stars 0 forks source link

[BTC]: Crash happening sometimes when Btc wallets are loading. #527

Open dmigwi opened 1 year ago

dmigwi commented 1 year ago

Issue first identified here: https://code.cryptopower.dev/group/cryptopower/-/merge_requests/1147#note_9091

How to replicate this crash:

I got this crash:

2022-11-28 16:10:45.808 [INF] BTC: Catching up block hashes to height 2408810, this might take a while
2022-11-28 16:10:45.809 [INF] BTC: Done catching up block hashes
2022-11-28 16:10:45.809 [INF] BTC: Finished rescan for 4843 addresses (synced to block 0000000000000010f7db3cade7e5c742d3ea514b715f6bfc449fd8b8885d7c4f, height 2408810)
panic: close of closed channel

goroutine 2820 [running]:
github.com/lightninglabs/neutrino.(*delayedCloser).closeNow.func1()
    /home/dmigwi/work/app/golang/pkg/mod/github.com/lightninglabs/neutrino@v0.14.2/query.go:1307 +0x25
sync.(*Once).doSlow(0x4cd097?, 0x3b9aca00?)
    /usr/local/go/src/sync/once.go:68 +0xc2
sync.(*Once).Do(...)
    /usr/local/go/src/sync/once.go:59
github.com/lightninglabs/neutrino.(*delayedCloser).closeNow(0xc008326960?)
    /home/dmigwi/work/app/golang/pkg/mod/github.com/lightninglabs/neutrino@v0.14.2/query.go:1306 +0x45
github.com/lightninglabs/neutrino.(*delayedCloser).closeEventually.func1()
    /home/dmigwi/work/app/golang/pkg/mod/github.com/lightninglabs/neutrino@v0.14.2/query.go:1300 +0xc9
created by github.com/lightninglabs/neutrino.(*delayedCloser).closeEventually
    /home/dmigwi/work/app/golang/pkg/mod/github.com/lightninglabs/neutrino@v0.14.2/query.go:1293 +0x72
exit status 2

(Issue originally authored by: @Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

As described here, this seems to be an issue on the neutrino v0.14.2 where different peers are resolving into the same IP address: https://github.com/lightninglabs/neutrino/issues/258#issuecomment-1271269499

By Migwi Ndung'u on 2022-12-06T00:26:24 (imported from GitLab)

(Comment originally authored by: @Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

This more of a malicious actor intentional causing this.

By Migwi Ndung'u on 2023-01-16T11:22:15 (imported from GitLab)

(Comment originally authored by: @Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

could you elaborate?

By Kennedy Izuegbu on 2023-01-16T11:22:15 (imported from GitLab)

(Comment originally authored by: @Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

assigned to @dmigwi

By Migwi Ndung'u on 2022-12-01T13:18:50 (imported from GitLab)

(Comment originally authored by: @Kennedy Izuegbu in gitlab.com)

dmigwi commented 1 year ago

unassigned @dmigwi

By Kennedy Izuegbu on 2023-01-16T11:21:57 (imported from GitLab)

(Comment originally authored by: @Kennedy Izuegbu in gitlab.com)