|
93 | 93 | OP_EQUALVERIFY |
94 | 94 | OP_CHECKSIG |
95 | 95 | ``` |
96 | | -So, you might think, if the `OP_DUP` is successful, then we get to do the first block, else the second. But that doesn't make any sense! Why wouldn't the `OP_DUP` succeed?! |
| 96 | +So, you might think, if the `OP_DUP` is successful, then we get to do the first block, else the second. But that doesn't make any sense! Why wouldn't the `OP_DUP` succeed? |
97 | 97 |
|
98 | 98 | And, indeed, it doesn't make any sense, because we accidentally read |
99 | 99 | the statement using thewrong notation. The correct reading of this is: |
@@ -229,13 +229,21 @@ Script: IF OP_CHECKSIG ELSE OP_DUP OP_HASH160 <pubKeyHashB> OP_EQUALVERIFY OP_CH |
229 | 229 | Running: <pubKeyHashB> <pubKeyHashA> OP_EQUAL |
230 | 230 | Stack: [ <signatureB> <pubKeyB> False ] |
231 | 231 | ``` |
232 | | -Whoop! The result was `False` because `<pubKeyHashB>` does not equal `<pubKeyHashA>`. Now when the `IF` runs, it collapses down to just the `ELSE` statement: |
| 232 | + |
| 233 | +Whoop! The result was `False` because `<pubKeyHashB>` does not equal |
| 234 | +`<pubKeyHashA>`. Now when the `IF` runs, it collapses down to just the |
| 235 | +`ELSE` statement: |
| 236 | + |
233 | 237 | ``` |
234 | 238 | Script: OP_DUP OP_HASH160 <pubKeyHashB> OP_EQUALVERIFY OP_CHECKSIG |
235 | 239 | Running: False IF |
236 | 240 | Stack: [ <signatureB> <pubKeyB> ] |
237 | 241 | ``` |
238 | | -Afterward, we go through the whole rigamarole again, starting with another `OP_DUP`, but eventually testing against the other `pubKeyHash`: |
| 242 | + |
| 243 | +Afterward, we go through the whole rigamarole again, starting with |
| 244 | +another `OP_DUP`, but eventually testing against the other |
| 245 | +`pubKeyHash`: |
| 246 | + |
239 | 247 | ``` |
240 | 248 | Script: OP_HASH160 <pubKeyHashB> OP_EQUALVERIFY OP_CHECKSIG |
241 | 249 | Running: <pubKeyB> OP_DUP |
|
0 commit comments