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

Bitcoin Core v22 deprecated addresses is not handled #6119

Closed
softsimon opened this issue Mar 24, 2022 · 7 comments · Fixed by #6123
Closed

Bitcoin Core v22 deprecated addresses is not handled #6119

softsimon opened this issue Mar 24, 2022 · 7 comments · Fixed by #6123

Comments

@softsimon
Copy link

softsimon commented Mar 24, 2022

Description

Since Bitcoin Core v22, the Bitcoin API has changed the format of how addresses are returned. So since v22 deprecatedrpc=addresses is required to get the old format and in v23 it's removed completely.

Bisq JSON blocks data export does not seem to handle this transition which breaks the Bisq block explorer if upgrading to the latest versions as addresses are not visible.

Steps to reproduce

Run Bitcoin Core v22 or later with default settings.
Latest Bisq version v1.8.4

Expected behaviour

The address field should be present

Screen Shot 2022-03-24 at 17 35 38

Actual behaviour

address is now missing in the JSON data that is dumped.

Screen Shot 2022-03-24 at 17 33 57

@boring-cyborg
Copy link

boring-cyborg bot commented Mar 24, 2022

Thanks for opening your first issue here!

Be sure to follow the issue template. Your issue will be reviewed by a maintainer and labeled for further action.

@wiz
Copy link
Member

wiz commented Mar 24, 2022

@chimp1984 would appreciate if you can take a look, currently this is holding up an upgrade of the mempool.space servers since it will break BSQ addresses from displaying on bisq.markets - thanks

@chimp1984
Copy link
Contributor

Ah damn Bitcoin RPC devs keep breaking APIs. @jmacxx could you have a look?

@ghost
Copy link

ghost commented Mar 24, 2022

Working on it.

String address = scriptPubKey.getAddresses() != null &&
scriptPubKey.getAddresses().size() == 1 ? scriptPubKey.getAddresses().get(0) : null;

The following change should fix it:

String address = new Script(Hex.decode(scriptPubKey.getHex()))
    .getToAddress(Config.baseCurrencyNetworkParameters()).toString();

@chimp1984
Copy link
Contributor

Please invite me for review once a PR is ready. DAO code is always a bit risky....

@alkum
Copy link
Contributor

alkum commented Mar 25, 2022

I think it should support both node behaviors (if v <= 22, .., else ..), otherwise RpcService.SUPPORTED_NODE_VERSION_RANGE would have to get more restrictive.

@wiz
Copy link
Member

wiz commented Mar 28, 2022

@jmacxx thanks, do you have a PR that I can test out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants