Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Our BitcoinJ fork sometimes fails to connect because of deprecated BTC alert system #4080

Open
dmos62 opened this issue Mar 21, 2020 · 1 comment
Labels

Comments

@dmos62
Copy link
Contributor

dmos62 commented Mar 21, 2020

In some cases BitcoinJ throws a ProtocolException, crashing the connection, because it receives an alert message during the handshake [0]. The alert message is sent because Bitcoin Core >= 0.14.0 is telling us to upgrade to atleast version 70012 [1][2].

It would be difficult to predict the consequences of changing the advertised version. We could just have BitcoinJ always ignore alert messages (which are deprecated and only useful/used for locking out very old clients). It seems that our fork already is attempting to do that, and the handshake case is an oversight.

I've discovered this when testing a local Bitcoin node that is set to prune. So far this is the only setup where I've received an alert message during handshake. I couldn't discover why.

[0] https://github.com/bisq-network/bitcoinj/blob/bisq_0.14.7/core/src/main/java/org/bitcoinj/core/Peer.java#L474
[1] bitcoin/bitcoin@8ff8d21
[2] https://en.bitcoin.it/wiki/Alert_system

@wiz
Copy link
Member

wiz commented Mar 21, 2020

Yeah, it also reproduces if you ./bisq-desktop --baseCurrencyNetwork=BTC_TESTNET

@ripcurlx ripcurlx added the a:bug label Mar 23, 2020
dmos62 added a commit to dmos62/bitcoinj that referenced this issue Feb 3, 2021
This keeps an erronious protocol exception from being thrown if an
alert message is received before a version message is received.

Fixes bisq-network/bisq#4080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants