bitcoinjs / bitcoinjs-lib

A javascript Bitcoin library for node.js and browsers.
MIT License
5.65k stars 2.09k forks source link

txOutputs of PSBT fails for nonstandard outputs #1577

Closed sidhujag closed 4 years ago

sidhujag commented 4 years ago

https://github.com/bitcoinjs/bitcoinjs-lib/blob/85ee2a3c5d1cdbf111232e6eb00ce0ce3bc398a6/src/psbt.js#L123

Seems to have an issue with nonstandard outputs, is it supposed to support OP_RETURN outputs? We should be able to get all outputs even nonstandard ones.

lukechilds commented 4 years ago

@sidhujag good catch, yes we should definitely be handling that.

@junderw what do you think we should we do here?

junderw commented 4 years ago

try/catch and return undefined for scripts that fail

Do this. I'll push out a patch.

junderw commented 4 years ago

update to patched v5.1.9.

Thanks for the report.