Skip to content

Comments

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

Open
switck wants to merge 2 commits intosipa:masterfrom
switck:pr-details
Open

ref/c: segwit_decode_addr_details: capture details and return#57
switck wants to merge 2 commits intosipa:masterfrom
switck:pr-details

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