lightninglabs / neutrino

Privacy-Preserving Bitcoin Light Client
MIT License
900 stars 183 forks source link

Fix TX reject messages not being counted anymore #247

Closed guggero closed 2 years ago

guggero commented 2 years ago

This is a follow-up PR to fix an issue that https://github.com/lightninglabs/neutrino/pull/240 seems to have introduced. When we close the peerQuit channel after receiving an INV message, we don't wait for any reject messages from that peer.

Instead we want to wait a bit longer after an INV message to make sure they don't respond with a reject message. Otherwise we would never detect a double spend TX with Neutrino (this was found through a unit test in lnd: https://github.com/lightningnetwork/lnd/pull/6285#issuecomment-1047332223)

Not sure if this proposed solution is any better, I'm definitely open for suggestions as I'm not too familiar with this code base.

lightninglabs-deploy commented 2 years ago

@ellemouton: review reminder @guggero, remember to re-request review from reviewers when ready