File tree Expand file tree Collapse file tree 3 files changed +26
-10
lines changed Expand file tree Collapse file tree 3 files changed +26
-10
lines changed Original file line number Diff line number Diff line change 1+ # 5.1.9
2+ __ fixed__
3+ - Fixed errors for psbt.txOutputs getter (#1578 )
4+
15# 5.1.8
26__ fixed__
37- Throw errors when p2wsh or p2wpkh contain uncompressed pubkeys (#1573 )
Original file line number Diff line number Diff line change @@ -117,11 +117,17 @@ class Psbt {
117117 } ) ) ;
118118 }
119119 get txOutputs ( ) {
120- return this . __CACHE . __TX . outs . map ( output => ( {
121- script : bufferutils_1 . cloneBuffer ( output . script ) ,
122- value : output . value ,
123- address : address_1 . fromOutputScript ( output . script , this . opts . network ) ,
124- } ) ) ;
120+ return this . __CACHE . __TX . outs . map ( output => {
121+ let address ;
122+ try {
123+ address = address_1 . fromOutputScript ( output . script , this . opts . network ) ;
124+ } catch ( _ ) { }
125+ return {
126+ script : bufferutils_1 . cloneBuffer ( output . script ) ,
127+ value : output . value ,
128+ address,
129+ } ;
130+ } ) ;
125131 }
126132 combine ( ...those ) {
127133 this . data . combine ( ...those . map ( o => o . data ) ) ;
Original file line number Diff line number Diff line change @@ -155,11 +155,17 @@ export class Psbt {
155155 }
156156
157157 get txOutputs ( ) : TransactionOutput [ ] {
158- return this . __CACHE . __TX . outs . map ( output => ( {
159- script : cloneBuffer ( output . script ) ,
160- value : output . value ,
161- address : fromOutputScript ( output . script , this . opts . network ) ,
162- } ) ) ;
158+ return this . __CACHE . __TX . outs . map ( output => {
159+ let address ;
160+ try {
161+ address = fromOutputScript ( output . script , this . opts . network ) ;
162+ } catch ( _ ) { }
163+ return {
164+ script : cloneBuffer ( output . script ) ,
165+ value : output . value ,
166+ address,
167+ } ;
168+ } ) ;
163169 }
164170
165171 combine ( ...those : Psbt [ ] ) : this {
You can’t perform that action at this time.
0 commit comments