Merge pull request #5494 from vostrnad/zero-multisig
Allow OP_0 in multisig scripts
This commit is contained in:
		
						commit
						e3c3f31ddb
					
				| @ -158,7 +158,7 @@ export function parseMultisigScript(script: string): void | { m: number, n: numb | |||||||
|   if (!opN) { |   if (!opN) { | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   if (!opN.startsWith('OP_PUSHNUM_')) { |   if (opN !== 'OP_0' && !opN.startsWith('OP_PUSHNUM_')) { | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   const n = parseInt(opN.match(/[0-9]+/)?.[0] || '', 10); |   const n = parseInt(opN.match(/[0-9]+/)?.[0] || '', 10); | ||||||
| @ -178,7 +178,7 @@ export function parseMultisigScript(script: string): void | { m: number, n: numb | |||||||
|   if (!opM) { |   if (!opM) { | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   if (!opM.startsWith('OP_PUSHNUM_')) { |   if (opM !== 'OP_0' && !opM.startsWith('OP_PUSHNUM_')) { | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   const m = parseInt(opM.match(/[0-9]+/)?.[0] || '', 10); |   const m = parseInt(opM.match(/[0-9]+/)?.[0] || '', 10); | ||||||
|  | |||||||
| @ -135,7 +135,7 @@ export function parseMultisigScript(script: string): void | { m: number, n: numb | |||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   const opN = ops.pop(); |   const opN = ops.pop(); | ||||||
|   if (!opN.startsWith('OP_PUSHNUM_')) { |   if (opN !== 'OP_0' && !opN.startsWith('OP_PUSHNUM_')) { | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   const n = parseInt(opN.match(/[0-9]+/)[0], 10); |   const n = parseInt(opN.match(/[0-9]+/)[0], 10); | ||||||
| @ -152,7 +152,7 @@ export function parseMultisigScript(script: string): void | { m: number, n: numb | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   const opM = ops.pop(); |   const opM = ops.pop(); | ||||||
|   if (!opM.startsWith('OP_PUSHNUM_')) { |   if (opM !== 'OP_0' && !opM.startsWith('OP_PUSHNUM_')) { | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   const m = parseInt(opM.match(/[0-9]+/)[0], 10); |   const m = parseInt(opM.match(/[0-9]+/)[0], 10); | ||||||
|  | |||||||
| @ -267,7 +267,7 @@ export function parseMultisigScript(script: string): undefined | { m: number, n: | |||||||
|   if (!opN) { |   if (!opN) { | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   if (!opN.startsWith('OP_PUSHNUM_')) { |   if (opN !== 'OP_0' && !opN.startsWith('OP_PUSHNUM_')) { | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   const n = parseInt(opN.match(/[0-9]+/)?.[0] || '', 10); |   const n = parseInt(opN.match(/[0-9]+/)?.[0] || '', 10); | ||||||
| @ -287,7 +287,7 @@ export function parseMultisigScript(script: string): undefined | { m: number, n: | |||||||
|   if (!opM) { |   if (!opM) { | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   if (!opM.startsWith('OP_PUSHNUM_')) { |   if (opM !== 'OP_0' && !opM.startsWith('OP_PUSHNUM_')) { | ||||||
|     return; |     return; | ||||||
|   } |   } | ||||||
|   const m = parseInt(opM.match(/[0-9]+/)?.[0] || '', 10); |   const m = parseInt(opM.match(/[0-9]+/)?.[0] || '', 10); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user