also detect uncompressed pubkeys + fix errors
This commit is contained in:
		
							parent
							
								
									bb8bfa0e3a
								
							
						
					
					
						commit
						9f3a3bd4d7
					
				| @ -73,8 +73,11 @@ export class AddressLabelsComponent implements OnInit { | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   detectMultisig(script: string) { |   detectMultisig(script: string) { | ||||||
|  |     if (!script) { | ||||||
|  |       return; | ||||||
|  |     } | ||||||
|     const ops = script.split(' '); |     const ops = script.split(' '); | ||||||
|     if (ops.pop() != 'OP_CHECKMULTISIG') { |     if (ops.length < 3 || ops.pop() != 'OP_CHECKMULTISIG') { | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     const opN = ops.pop(); |     const opN = ops.pop(); | ||||||
| @ -82,12 +85,15 @@ export class AddressLabelsComponent implements OnInit { | |||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|     const n = parseInt(opN.match(/[0-9]+/)[0]); |     const n = parseInt(opN.match(/[0-9]+/)[0]); | ||||||
|     // pop n public keys
 |     if (ops.length < n * 2 + 1) { | ||||||
|     for (var i = 0; i < n; i++) { |  | ||||||
|       if (ops.pop().length != 66) { |  | ||||||
|       return; |       return; | ||||||
|     } |     } | ||||||
|       if (ops.pop() != 'OP_PUSHBYTES_33') { |     // pop n public keys
 | ||||||
|  |     for (var i = 0; i < n; i++) { | ||||||
|  |       if (!/^0((2|3)\w{64}|4\w{128})$/.test(ops.pop())) { | ||||||
|  |         return; | ||||||
|  |       } | ||||||
|  |       if (!/^OP_PUSHBYTES_(33|65)$/.test(ops.pop())) { | ||||||
|         return; |         return; | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user