File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -318,6 +318,8 @@ class Transaction {
318318 hashSequences = bcrypto . sha256 ( bufferWriter . end ( ) ) ;
319319 }
320320 if ( ! ( isNone || isSingle ) ) {
321+ if ( ! this . outs . length )
322+ throw new Error ( 'Add outputs to the transaction before signing.' ) ;
321323 const txOutsSize = this . outs
322324 . map ( output => 8 + varSliceSize ( output . script ) )
323325 . reduce ( ( a , b ) => a + b ) ;
Original file line number Diff line number Diff line change @@ -414,6 +414,8 @@ export class Transaction {
414414 }
415415
416416 if ( ! ( isNone || isSingle ) ) {
417+ if ( ! this . outs . length )
418+ throw new Error ( 'Add outputs to the transaction before signing.' ) ;
417419 const txOutsSize = this . outs
418420 . map ( output => 8 + varSliceSize ( output . script ) )
419421 . reduce ( ( a , b ) => a + b ) ;
You can’t perform that action at this time.
0 commit comments