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

ref/c: segwit_decode_addr_details: capture details and return #57

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

switck
Copy link

@switck switck commented Feb 3, 2021

kept same API, but added a less-opinionated interface, that will allow caller to detect bech32m/not, incorrect HRP and report details to users

if(hrp_out) {
strncpy(hrp_out, hrp_actual, 20);
}
if(enc_out) *enc_out = enc;
Copy link
Owner

@sipa sipa Feb 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like this. I cannot imagine a case where a caller is interested in valid or not, without caring if it's bech32 or bech32m. Validity is defined w.r.t. a specific standard.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can make the enc_out argument required

@switck
Copy link
Author

switck commented Feb 5, 2021

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 this pull request may close these issues.

2 participants