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.
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.