-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Not allow bitcoinj to auto connect to localhost when localhost was not detected by client #3783
Not allow bitcoinj to auto connect to localhost when localhost was not detected by client #3783
Conversation
…t detected by client This fixes the problem if the local bitcoin core node is not detected by our client, but bitcoinj is able to connect to it because of the auto connect to localhost behavior. In that case the minimum required nodes to broadcast a transaction will be 4 (provided nodes settings), but bitcoinj will only connect to one node. The requirement of 4 nodes will be never fulfilled and the transaction never broadcasted.
I found this issue when I experienced a trade failure myself where the logs showed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
This would only fail for users that run full bitcoind nodes locally, right? What is the workaround if a user encounters this? restart? Is waiting for the Jan release sufficient or is this a hotfix candidate? |
Yes
Should solve the problem also if you have a transaction already in limbo. Unfortunately for me it wasn't solved with a restart and after a SPV resync the transaction was removed by bitcoinj.
I don't think this is something new, so I think it should be fine to ship it in the next release. |
I think that happens only in edge cases. At startup we connect to localhost ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
This fixes the problem if the local bitcoin core node is not detected by our client,
but bitcoinj is able to connect to it because of the auto connect to localhost behavior.
In that case the minimum required nodes to broadcast a transaction will be 4 (provided nodes settings),
but bitcoinj will only connect to one node. The requirement of 4 nodes will be never fulfilled and
the transaction never broadcasted.
Testing
As this is a bug based on the default localhost connect behavior of bitcoinj it is difficult to simulate on regtest.
To simulate this behavior on mainnet you could try following steps:
step 3
4