@@ -270,10 +270,8 @@ <h1 id="secp256k1-blake160-multisig-all">secp256k1-blake160-multisig-all</h1>
270
270
271
271
</ div >
272
272
273
- < div class ="content "> < div class ='highlight '> < pre > < span class ="hljs-type "> uint64_t</ span > since = < span class ="hljs-number "> 0</ span > ;
274
- < span class ="hljs-keyword "> if</ span > (args_bytes_seg.size == BLAKE160_SIZE + < span class ="hljs-keyword "> sizeof</ span > (< span class ="hljs-type "> uint64_t</ span > )) {
275
- since = *(< span class ="hljs-type "> uint64_t</ span > *)&args_bytes_seg.ptr[BLAKE160_SIZE];
276
- }</ pre > </ div > </ div >
273
+ < div class ="content "> < div class ='highlight '> < pre > < span class ="hljs-keyword "> if</ span > (args_bytes_seg.size == BLAKE160_SIZE + < span class ="hljs-keyword "> sizeof</ span > (< span class ="hljs-type "> uint64_t</ span > )) {
274
+ < span class ="hljs-type "> uint64_t</ span > since = *(< span class ="hljs-type "> uint64_t</ span > *)&args_bytes_seg.ptr[BLAKE160_SIZE];</ pre > </ div > </ div >
277
275
278
276
</ li >
279
277
@@ -284,6 +282,25 @@ <h1 id="secp256k1-blake160-multisig-all">secp256k1-blake160-multisig-all</h1>
284
282
< div class ="sswrap ">
285
283
< a class ="ss " href ="#section-11 "> §</ a >
286
284
</ div >
285
+ < p > Check lock period logic, we have prepared a handy utility function for this.</ p >
286
+
287
+ </ div >
288
+
289
+ < div class ="content "> < div class ='highlight '> < pre > ret = check_since(since);
290
+ < span class ="hljs-keyword "> if</ span > (ret != CKB_SUCCESS) {
291
+ < span class ="hljs-keyword "> return</ span > ret;
292
+ }
293
+ }</ pre > </ div > </ div >
294
+
295
+ </ li >
296
+
297
+
298
+ < li id ="section-12 ">
299
+ < div class ="annotation ">
300
+
301
+ < div class ="sswrap ">
302
+ < a class ="ss " href ="#section-12 "> §</ a >
303
+ </ div >
287
304
< p > Load the first witness, or the witness of the same index as the first input using
288
305
current script.</ p >
289
306
@@ -302,11 +319,11 @@ <h1 id="secp256k1-blake160-multisig-all">secp256k1-blake160-multisig-all</h1>
302
319
</ li >
303
320
304
321
305
- < li id ="section-12 ">
322
+ < li id ="section-13 ">
306
323
< div class ="annotation ">
307
324
308
325
< div class ="sswrap ">
309
- < a class ="ss " href ="#section-12 "> §</ a >
326
+ < a class ="ss " href ="#section-13 "> §</ a >
310
327
</ div >
311
328
< p > We will treat the first witness as WitnessArgs object, and extract the lock field
312
329
from the object.</ p >
@@ -326,11 +343,11 @@ <h1 id="secp256k1-blake160-multisig-all">secp256k1-blake160-multisig-all</h1>
326
343
</ li >
327
344
328
345
329
- < li id ="section-13 ">
346
+ < li id ="section-14 ">
330
347
< div class ="annotation ">
331
348
332
349
< div class ="sswrap ">
333
- < a class ="ss " href ="#section-13 "> §</ a >
350
+ < a class ="ss " href ="#section-14 "> §</ a >
334
351
</ div >
335
352
< p > This is more of a safe guard, since lock is a field in witness, it
336
353
cannot exceed the maximum size of the enclosing witness, this way
@@ -346,11 +363,11 @@ <h1 id="secp256k1-blake160-multisig-all">secp256k1-blake160-multisig-all</h1>
346
363
</ li >
347
364
348
365
349
- < li id ="section-14 ">
366
+ < li id ="section-15 ">
350
367
< div class ="annotation ">
351
368
352
369
< div class ="sswrap ">
353
- < a class ="ss " href ="#section-14 "> §</ a >
370
+ < a class ="ss " href ="#section-15 "> §</ a >
354
371
</ div >
355
372
< p > Keep the full lock field somewhere, since later we will modify this field in place.</ p >
356
373
@@ -363,11 +380,11 @@ <h1 id="secp256k1-blake160-multisig-all">secp256k1-blake160-multisig-all</h1>
363
380
</ li >
364
381
365
382
366
- < li id ="section-15 ">
383
+ < li id ="section-16 ">
367
384
< div class ="annotation ">
368
385
369
386
< div class ="sswrap ">
370
- < a class ="ss " href ="#section-15 "> §</ a >
387
+ < a class ="ss " href ="#section-16 "> §</ a >
371
388
</ div >
372
389
< p > Extract multisig script flags.</ p >
373
390
@@ -396,11 +413,11 @@ <h1 id="secp256k1-blake160-multisig-all">secp256k1-blake160-multisig-all</h1>
396
413
</ li >
397
414
398
415
399
- < li id ="section-16 ">
416
+ < li id ="section-17 ">
400
417
< div class ="annotation ">
401
418
402
419
< div class ="sswrap ">
403
- < a class ="ss " href ="#section-16 "> §</ a >
420
+ < a class ="ss " href ="#section-17 "> §</ a >
404
421
</ div >
405
422
< p > Based on the number of public keys and thresholds, we can calculate
406
423
the required length of the lock field.</ p >
@@ -417,11 +434,11 @@ <h1 id="secp256k1-blake160-multisig-all">secp256k1-blake160-multisig-all</h1>
417
434
</ li >
418
435
419
436
420
- < li id ="section-17 ">
437
+ < li id ="section-18 ">
421
438
< div class ="annotation ">
422
439
423
440
< div class ="sswrap ">
424
- < a class ="ss " href ="#section-17 "> §</ a >
441
+ < a class ="ss " href ="#section-18 "> §</ a >
425
442
</ div >
426
443
< p > Perform hash check of the < code > multisig_script</ code > part, notice the signature part
427
444
is not included here.</ p >
@@ -440,24 +457,6 @@ <h1 id="secp256k1-blake160-multisig-all">secp256k1-blake160-multisig-all</h1>
440
457
</ li >
441
458
442
459
443
- < li id ="section-18 ">
444
- < div class ="annotation ">
445
-
446
- < div class ="sswrap ">
447
- < a class ="ss " href ="#section-18 "> §</ a >
448
- </ div >
449
- < p > Check lock period logic, we have prepared a handy utility function for this.</ p >
450
-
451
- </ div >
452
-
453
- < div class ="content "> < div class ='highlight '> < pre > ret = check_since(since);
454
- < span class ="hljs-keyword "> if</ span > (ret != CKB_SUCCESS) {
455
- < span class ="hljs-keyword "> return</ span > ret;
456
- }</ pre > </ div > </ div >
457
-
458
- </ li >
459
-
460
-
461
460
< li id ="section-19 ">
462
461
< div class ="annotation ">
463
462
0 commit comments