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
+
1
5
# 5.1.8
2
6
__ fixed__
3
7
- 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 {
117
117
} ) ) ;
118
118
}
119
119
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
+ } ) ;
125
131
}
126
132
combine ( ...those ) {
127
133
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 {
155
155
}
156
156
157
157
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
+ } ) ;
163
169
}
164
170
165
171
combine ( ...those : Psbt [ ] ) : this {
You can’t perform that action at this time.
0 commit comments