File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -350,15 +350,17 @@ class TinyChainBlock {
350350 * and ensures that the signature is valid. If any signature is invalid,
351351 * it throws an error identifying the problematic transaction and its index.
352352 *
353- * @throws {Error } If any transaction has an invalid ECDSA signature or if the
354- * number of validated transactions does not match the expected count .
353+ * @throws {Error } If any transaction has an invalid ECDSA signature,
354+ * or if any transaction has an address equal to "0" .
355355 */
356356 validateSig ( ) {
357357 const dc = this . getData ( ) ;
358358 const sigs = this . getSigs ( ) ;
359359 for ( const index in dc ) {
360360 const data = dc [ index ] ;
361361 const sig = sigs [ index ] ;
362+ if ( data . address === '0' )
363+ throw new Error ( `Transaction at index "${ index } " has an invalid address "0".` ) ;
362364 if (
363365 ! this . #signer. verifyECDSA (
364366 this . #parser. serializeDeep ( data ) ,
You can’t perform that action at this time.
0 commit comments