@@ -28,15 +28,14 @@ int32_t pax_fiatstatus(uint64_t *available,uint64_t *deposited,uint64_t *issued,
28
28
* withdrawn = sp -> withdrawn ;
29
29
* approved = sp -> approved ;
30
30
* redeemed = sp -> redeemed ;
31
- //netliability = (sp->deposited - sp->withdrawn) - sp->shorted;
32
31
maxval = sp -> approved ;
33
32
if ( sp -> withdrawn > maxval )
34
33
maxval = sp -> withdrawn ;
35
34
netliability = (sp -> issued - maxval ) - sp -> shorted ;
36
35
maxallowed = komodo_maxallowed (baseid );
37
36
if ( netliability < maxallowed )
38
37
* available = (maxallowed - netliability );
39
- // printf("%p % s %.8f %.8f %.8f %.8f %.8f\n",sp ,base,dstr(*deposited),dstr(*issued),dstr(*withdrawn),dstr(*approved),dstr(*redeemed));
38
+ printf ("%llu - %llu % s %.8f %.8f %.8f %.8f %.8f\n" ,( long long ) maxallowed ,( long long ) netliability ,base ,dstr (* deposited ),dstr (* issued ),dstr (* withdrawn ),dstr (* approved ),dstr (* redeemed ));
40
39
return (0 );
41
40
} else printf ("pax_fiatstatus cant get basesp.%s\n" ,base );
42
41
} // else printf("pax_fiatstatus illegal base.%s\n",base);
@@ -60,22 +59,12 @@ struct pax_transaction *komodo_paxfind(uint256 txid,uint16_t vout,uint8_t type)
60
59
return (pax );
61
60
}
62
61
63
- struct pax_transaction * komodo_paxfinds (int32_t strictflag , uint256 txid ,uint16_t vout )
62
+ struct pax_transaction * komodo_paxfinds (uint256 txid ,uint16_t vout )
64
63
{
65
64
struct pax_transaction * pax ; int32_t i ; uint8_t types [] = { 'I' , 'D' , 'X' , 'A' , 'W' };
66
- if ( strictflag != 0 )
67
- {
68
- if ( (pax = komodo_paxfind (txid ,vout ,'D' )) != 0 )
65
+ for (i = 0 ; i < sizeof (types )/sizeof (* types ); i ++ )
66
+ if ( (pax = komodo_paxfind (txid ,vout ,types [i ])) != 0 )
69
67
return (pax );
70
- //if ( (pax= komodo_paxfind(txid,vout,'X')) != 0 )
71
- // return(pax);
72
- }
73
- else
74
- {
75
- for (i = 0 ; i < sizeof (types )/sizeof (* types ); i ++ )
76
- if ( (pax = komodo_paxfind (txid ,vout ,types [i ])) != 0 )
77
- return (pax );
78
- }
79
68
return (0 );
80
69
}
81
70
@@ -258,7 +247,7 @@ int32_t komodo_issued_opreturn(char *base,uint256 *txids,uint16_t *vouts,int64_t
258
247
vouts [n ] = opretbuf [len ++ ];
259
248
vouts [n ] = (opretbuf [len ++ ] << 8 ) | vouts [n ];
260
249
baseids [n ] = komodo_baseid (base );
261
- if ( (pax = komodo_paxfinds (0 , txids [n ],vouts [n ])) != 0 )
250
+ if ( (pax = komodo_paxfinds (txids [n ],vouts [n ])) != 0 )
262
251
{
263
252
values [n ] = (strcmp ("KMD" ,base ) == 0 ) ? pax -> komodoshis : pax -> fiatoshis ;
264
253
srcvalues [n ] = (strcmp ("KMD" ,base ) == 0 ) ? pax -> fiatoshis : pax -> komodoshis ;
@@ -279,7 +268,7 @@ int32_t komodo_paxcmp(char *symbol,int32_t kmdheight,uint64_t value,uint64_t che
279
268
if ( seed == 0 && checkvalue != 0 )
280
269
{
281
270
ratio = ((value << 6 ) / checkvalue );
282
- if ( ratio >= 63 && ratio <= 65 )
271
+ if ( ratio >= 62 && ratio <= 66 )
283
272
return (0 );
284
273
else
285
274
{
@@ -357,11 +346,8 @@ uint64_t komodo_paxtotal()
357
346
HASH_ITER (hh ,PAX ,pax ,tmp )
358
347
{
359
348
pax -> ready = 0 ;
360
- char str [65 ],coinaddr [64 ]; bits256 tmp ;
361
- bitcoin_address (coinaddr ,60 ,pax -> rmd160 ,20 );
362
- memcpy (& tmp ,& pax -> txid ,sizeof (tmp ));
363
- if ( 0 && pax -> fiatoshis > 9000 * SATOSHIDEN )//pax->type == 'A' )
364
- printf ("(%s).%c pax.%s <- %s marked.%d %.8f -> %.8f validated.%d approved.%d %s\n" ,coinaddr ,pax -> type ,pax -> symbol ,pax -> source ,pax -> marked ,dstr (pax -> komodoshis ),dstr (pax -> fiatoshis ),pax -> validated != 0 ,pax -> approved != 0 ,bits256_str (str ,tmp ));
349
+ if ( 0 && pax -> type == 'A' )
350
+ printf ("%p pax.%s <- %s marked.%d %.8f -> %.8f validated.%d approved.%d\n" ,pax ,pax -> symbol ,pax -> source ,pax -> marked ,dstr (pax -> komodoshis ),dstr (pax -> fiatoshis ),pax -> validated != 0 ,pax -> approved != 0 );
365
351
if ( pax -> marked != 0 )
366
352
continue ;
367
353
if ( strcmp (symbol ,pax -> symbol ) == 0 || pax -> type == 'A' )
@@ -442,7 +428,7 @@ int32_t komodo_pending_withdraws(char *opretstr) // todo: enforce deterministic
442
428
if ( pax2 -> approved != 0 )
443
429
pax -> approved = pax2 -> approved ;
444
430
}
445
- else if ( (pax2 = komodo_paxfind (pax -> txid ,pax -> vout ,'x ' )) != 0 )
431
+ else if ( (pax2 = komodo_paxfind (pax -> txid ,pax -> vout ,'X ' )) != 0 )
446
432
pax -> approved = pax -> height ;
447
433
//printf("pending_withdraw: pax %s marked.%u approved.%u validated.%llu\n",pax->symbol,pax->marked,pax->approved,(long long)pax->validated);
448
434
if ( pax -> marked == 0 && pax -> approved == 0 && pax -> validated != 0 ) //strcmp((char *)"KMD",pax->symbol) == 0 &&
@@ -477,7 +463,7 @@ int32_t komodo_pending_withdraws(char *opretstr) // todo: enforce deterministic
477
463
int32_t komodo_gateway_deposits (CMutableTransaction * txNew ,char * base ,int32_t tokomodo )
478
464
{
479
465
struct pax_transaction * pax ,* tmp ; char symbol [16 ],dest [16 ]; uint8_t * script ,opcode ,opret [16384 ],data [16384 ]; int32_t i ,baseid ,ht ,len = 0 ,opretlen = 0 ,numvouts = 1 ; struct komodo_state * sp ; uint64_t available ,deposited ,issued ,withdrawn ,approved ,redeemed ,mask ;
480
- if ( KOMODO_PAX == 0 || KOMODO_PASSPORT_INITDONE == 0 || ASSETCHAINS_SYMBOL [ 0 ] == 0 )
466
+ if ( KOMODO_PAX == 0 || KOMODO_PASSPORT_INITDONE == 0 )
481
467
return (0 );
482
468
struct komodo_state * kmdsp = komodo_stateptrget ((char * )"KMD" );
483
469
sp = komodo_stateptr (symbol ,dest );
@@ -503,7 +489,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to
503
489
else
504
490
{
505
491
opcode = 'X' ;
506
- if ( komodo_paxtotal () == 0 )
492
+ if ( 1 || komodo_paxtotal () == 0 )
507
493
return (0 );
508
494
}
509
495
HASH_ITER (hh ,PAX ,pax ,tmp )
@@ -514,7 +500,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to
514
500
#ifdef KOMODO_ASSETCHAINS_WAITNOTARIZE
515
501
if ( pax -> height > 236000 )
516
502
{
517
- if ( pax -> type == 'D' || ( kmdsp != 0 && kmdsp -> NOTARIZED_HEIGHT >= pax -> height ) )
503
+ if ( kmdsp != 0 && kmdsp -> NOTARIZED_HEIGHT >= pax -> height )
518
504
pax -> validated = pax -> komodoshis ;
519
505
else if ( kmdsp -> CURRENT_HEIGHT > pax -> height + 30 )
520
506
pax -> validated = pax -> ready = 0 ;
@@ -533,7 +519,6 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to
533
519
{
534
520
if ( pax -> height > 214700 || strcmp (ASSETCHAINS_SYMBOL ,symbol ) == 0 )
535
521
printf ("miner.[%s]: skip %s %.8f when avail %.8f deposited %.8f, issued %.8f withdrawn %.8f approved %.8f redeemed %.8f\n" ,ASSETCHAINS_SYMBOL ,symbol ,dstr (pax -> fiatoshis ),dstr (available ),dstr (deposited ),dstr (issued ),dstr (withdrawn ),dstr (approved ),dstr (redeemed ));
536
- pax -> marked = pax -> fiatoshis ;
537
522
continue ;
538
523
}
539
524
/*printf("pax.%s marked.%d %.8f -> %.8f ready.%d validated.%d\n",pax->symbol,pax->marked,dstr(pax->komodoshis),dstr(pax->fiatoshis),pax->ready!=0,pax->validated!=0);
@@ -546,6 +531,7 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to
546
531
{
547
532
if ( strcmp (pax -> symbol ,ASSETCHAINS_SYMBOL ) == 0 )
548
533
printf ("pax->symbol.%s != %s or null pax->validated %.8f ready.%d ht.(%d %d)\n" ,pax -> symbol ,symbol ,dstr (pax -> validated ),pax -> ready ,kmdsp -> CURRENT_HEIGHT ,pax -> height );
534
+ pax -> marked = pax -> fiatoshis ;
549
535
continue ;
550
536
}
551
537
if ( pax -> ready == 0 )
@@ -599,12 +585,9 @@ int32_t komodo_gateway_deposits(CMutableTransaction *txNew,char *base,int32_t to
599
585
for (i = 0 ; symbol [i ]!= 0 ; i ++ )
600
586
data [len ++ ] = symbol [i ];
601
587
data [len ++ ] = 0 ;
602
- if ( 0 && pax != 0 )
603
- {
604
- for (i = 0 ; i < 32 ; i ++ )
605
- printf ("%02x" ,((uint8_t * )& pax -> txid )[32 - 1 - i ]);
606
- printf (" <- data[%d]\n" ,len );
607
- }
588
+ for (i = 0 ; i < len ; i ++ )
589
+ printf ("%02x" ,data [i ]);
590
+ printf (" <- data[%d]\n" ,len );
608
591
opretlen = komodo_opreturnscript (opret ,opcode ,data ,len );
609
592
txNew -> vout .resize (numvouts + 1 );
610
593
txNew -> vout [numvouts ].nValue = 0 ;
@@ -651,7 +634,7 @@ void komodo_bannedset(uint256 *array,int32_t max)
651
634
int32_t komodo_check_deposit (int32_t height ,const CBlock & block ) // verify above block is valid pax pricing
652
635
{
653
636
static uint256 array [15 ];
654
- int32_t i ,j ,k ,n ,ht ,retval , txn_count ,num ,opretlen ,offset = 1 ,errs = 0 ,matched = 0 ,kmdheights [64 ],otherheights [64 ]; uint256 hash ,txids [64 ]; char symbol [16 ],base [16 ]; uint16_t vouts [64 ]; int8_t baseids [64 ]; uint8_t * script ,opcode ,rmd160s [64 * 20 ]; uint64_t maxval , total ,available ,deposited ,issued ,withdrawn ,approved ,redeemed ; int64_t values [64 ],srcvalues [64 ]; struct pax_transaction * pax ; struct komodo_state * sp ;
637
+ int32_t i ,j ,k ,n ,ht ,txn_count ,num ,opretlen ,offset = 1 ,errs = 0 ,matched = 0 ,kmdheights [64 ],otherheights [64 ]; uint256 hash ,txids [64 ]; char symbol [16 ],base [16 ]; uint16_t vouts [64 ]; int8_t baseids [64 ]; uint8_t * script ,opcode ,rmd160s [64 * 20 ]; uint64_t total ,available ,deposited ,issued ,withdrawn ,approved ,redeemed ; int64_t values [64 ],srcvalues [64 ]; struct pax_transaction * pax ; struct komodo_state * sp ;
655
638
if ( * (int32_t * )& array [0 ] == 0 )
656
639
komodo_bannedset (array ,(int32_t )(sizeof (array )/sizeof (* array )));
657
640
memset (baseids ,0xff ,sizeof (baseids ));
@@ -680,10 +663,24 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
680
663
script = (uint8_t * )block .vtx [0 ].vout [n - 1 ].scriptPubKey .data ();
681
664
if ( n <= 2 || script [0 ] != 0x6a )
682
665
{
666
+ int64_t val ,prevtotal = 0 ; int32_t overflow = 0 ;
683
667
total = 0 ;
684
668
for (i = 1 ; i < n ; i ++ )
685
- total += block .vtx [0 ].vout [i ].nValue ;
686
- if ( total > COIN /10 )
669
+ {
670
+ if ( (val = block .vtx [0 ].vout [i ].nValue ) < 0 || val >= MAX_MONEY )
671
+ {
672
+ overflow = 1 ;
673
+ break ;
674
+ }
675
+ total += val ;
676
+ if ( total < prevtotal || (val != 0 && total == prevtotal ) )
677
+ {
678
+ overflow = 1 ;
679
+ break ;
680
+ }
681
+ prevtotal = total ;
682
+ }
683
+ if ( overflow != 0 || total > COIN /10 )
687
684
{
688
685
//fprintf(stderr,">>>>>>>> <<<<<<<<<< ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block.vtx[0].vout[1].nValue),n);
689
686
if ( height >= 235300 )
@@ -701,9 +698,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
701
698
// printf("%02x",script[i]);
702
699
//printf(" height.%d checkdeposit n.%d [%02x] [%c] %d vs %d\n",height,n,script[0],script[offset],script[offset],'X');
703
700
opcode = 'X' ;
704
- strcpy (symbol ,(char * )"KMD" );
705
701
if ( height >= 235300 )
706
- return (-1 ); // no redeems for now
702
+ return (-1 );
703
+ strcpy (symbol ,(char * )"KMD" );
707
704
}
708
705
else
709
706
{
@@ -731,23 +728,15 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
731
728
matched++;
732
729
continue;*/
733
730
}
734
- if ( (pax = komodo_paxfinds (0 , txids [i - 1 ],vouts [i - 1 ])) != 0 ) // finds... make sure right one
731
+ if ( (pax = komodo_paxfinds (txids [i - 1 ],vouts [i - 1 ])) != 0 ) // finds... make sure right one
735
732
{
736
733
pax -> type = opcode ;
737
- if ( pax_fiatstatus (& available ,& deposited ,& issued ,& withdrawn ,& approved ,& redeemed ,symbol ) < 0 )
738
- {
739
- matched ++ ; // this node isnt running this assetchain, leaves validation to others
740
- continue ;
741
- }
742
- maxval = approved ;
743
- if ( redeemed > maxval )
744
- maxval = redeemed ;
745
- if ( (opcode == 'I' && available < pax -> fiatoshis ) || (opcode == 'X' && pax -> komodoshis > issued - maxval ) )
734
+ if ( opcode == 'I' && (pax_fiatstatus (& available ,& deposited ,& issued ,& withdrawn ,& approved ,& redeemed ,symbol ) != 0 || available < pax -> fiatoshis ) )
746
735
{
747
736
printf ("checkdeposit.[%s]: skip %s %.8f when avail %.8f deposited %.8f, issued %.8f withdrawn %.8f approved %.8f redeemed %.8f\n" ,ASSETCHAINS_SYMBOL ,symbol ,dstr (pax -> fiatoshis ),dstr (available ),dstr (deposited ),dstr (issued ),dstr (withdrawn ),dstr (approved ),dstr (redeemed ));
748
737
continue ;
749
738
}
750
- if ( (opcode == 'I' && pax -> fiatoshis == block .vtx [0 ].vout [i ].nValue ) || (opcode == 'X' && pax -> komodoshis == block .vtx [0 ].vout [i ].nValue ) )
739
+ if ( (( opcode == 'I' && ( pax -> fiatoshis == 0 || pax -> fiatoshis == block .vtx [0 ].vout [i ].nValue )) || (opcode == 'X' && ( pax -> komodoshis == 0 || pax -> komodoshis == block .vtx [0 ].vout [i ].nValue )) ) )
751
740
{
752
741
if ( pax -> marked != 0 && height >= 80820 )
753
742
{
@@ -818,7 +807,7 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
818
807
819
808
const char * komodo_opreturn (int32_t height ,uint64_t value ,uint8_t * opretbuf ,int32_t opretlen ,uint256 txid ,uint16_t vout ,char * source )
820
809
{
821
- uint8_t rmd160 [20 ],rmd160s [64 * 20 ],addrtype ,shortflag ,pubkey33 [33 ]; int32_t didstats ,i ,j ,n ,kvheight ,len ,tokomodo ,kmdheight ,otherheights [64 ],kmdheights [64 ]; int8_t baseids [64 ]; char base [4 ],coinaddr [64 ],destaddr [64 ]; uint256 txids [64 ]; uint16_t vouts [64 ]; uint64_t convtoshis ,seed ; int64_t fee ,fiatoshis ,komodoshis ,checktoshis ,values [64 ],srcvalues [64 ]; struct pax_transaction * pax ,* pax2 ; struct komodo_state * basesp ; double diff ;
810
+ uint8_t rmd160 [20 ],rmd160s [64 * 20 ],addrtype ,shortflag ,pubkey33 [33 ]; int32_t didstats ,i ,j ,n ,kvheight ,len ,tokomodo ,kmdheight ,otherheights [64 ],kmdheights [64 ]; int8_t baseids [64 ]; char base [4 ],coinaddr [64 ],destaddr [64 ]; uint256 txids [64 ]; uint16_t vouts [64 ]; uint64_t convtoshis ,seed ; int64_t fee ,fiatoshis ,komodoshis ,checktoshis ,values [64 ],srcvalues [64 ]; struct pax_transaction * pax ,* pax2 ; struct komodo_state * basesp ; double diff ;
822
811
const char * typestr = "unknown" ;
823
812
if ( ASSETCHAINS_SYMBOL [0 ] != 0 && komodo_baseid (ASSETCHAINS_SYMBOL ) < 0 && opretbuf [0 ] != 'K' )
824
813
{
@@ -852,9 +841,9 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
852
841
if ( kmdheight > 195000 || kmdheight <= height )
853
842
{
854
843
didstats = 0 ;
855
- if ( 1 && strcmp ( "EUR" , ASSETCHAINS_SYMBOL ) == 0 && kmdheight > 214700 && strcmp (base ,ASSETCHAINS_SYMBOL ) == 0 )
844
+ if ( 0 && kmdheight > 214700 && strcmp (base ,ASSETCHAINS_SYMBOL ) == 0 )
856
845
{
857
- printf ("(%s) (%s) kmdheight.%d vs height.%d check %.8f vs %.8f tokomodo.%d %d seed.%llx paxcmp.%d \n" ,ASSETCHAINS_SYMBOL ,base ,kmdheight ,height ,dstr (checktoshis ),dstr (value ),komodo_is_issuer (),strncmp (ASSETCHAINS_SYMBOL ,base ,strlen (base )) == 0 ,(long long )seed , komodo_paxcmp ( base , kmdheight , value , checktoshis , 0 ) );
846
+ printf ("(%s) (%s) kmdheight.%d vs height.%d check %.8f vs %.8f tokomodo.%d %d seed.%llx\n" ,ASSETCHAINS_SYMBOL ,base ,kmdheight ,height ,dstr (checktoshis ),dstr (value ),komodo_is_issuer (),strncmp (ASSETCHAINS_SYMBOL ,base ,strlen (base )) == 0 ,(long long )seed );
858
847
for (i = 0 ; i < 32 ; i ++ )
859
848
printf ("%02x" ,((uint8_t * )& txid )[i ]);
860
849
printf (" <- txid.v%u " ,vout );
@@ -906,18 +895,19 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
906
895
basesp -> issued += pax2 -> fiatoshis ;
907
896
pax2 -> didstats = 1 ;
908
897
if ( 0 && strcmp (base ,ASSETCHAINS_SYMBOL ) == 0 )
909
- {
910
- char str [65 ]; bits256 tmp ;
911
- memcpy (& tmp ,& pax2 -> txid ,sizeof (tmp ));
912
- printf ("########### %p issueda %s += %.8f kmdheight.%d %.8f other.%d (%s)\n" ,basesp ,base ,dstr (pax2 -> fiatoshis ),pax2 -> height ,dstr (pax2 -> komodoshis ),pax2 -> otherheight ,bits256_str (str ,tmp ));
913
- }
898
+ printf ("########### %p issueda %s += %.8f kmdheight.%d %.8f other.%d\n" ,basesp ,base ,dstr (pax2 -> fiatoshis ),pax2 -> height ,dstr (pax2 -> komodoshis ),pax2 -> otherheight );
914
899
}
915
900
}
916
901
}
917
902
}
918
903
}
919
- else if ( kmdheight > 238000 && (kmdheight > 214700 || strcmp (base ,ASSETCHAINS_SYMBOL ) == 0 ) ) //seed != 0 &&
920
- printf ("pax %s deposit %.8f rejected kmdheight.%d %.8f KMD check %.8f seed.%llu\n" ,base ,dstr (fiatoshis ),kmdheight ,dstr (value ),dstr (checktoshis ),(long long )seed );
904
+ else
905
+ {
906
+ if ( (pax = komodo_paxfind (txid ,vout ,'D' )) != 0 )
907
+ pax -> marked = checktoshis ;
908
+ if ( kmdheight > 238000 && (kmdheight > 214700 || strcmp (base ,ASSETCHAINS_SYMBOL ) == 0 ) ) //seed != 0 &&
909
+ printf ("pax %s deposit %.8f rejected kmdheight.%d %.8f KMD check %.8f seed.%llu\n" ,base ,dstr (fiatoshis ),kmdheight ,dstr (value ),dstr (checktoshis ),(long long )seed );
910
+ }
921
911
} //else printf("paxdeposit height.%d vs kmdheight.%d\n",height,kmdheight);
922
912
}
923
913
}
@@ -956,7 +946,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
956
946
pax -> didstats = 1 ;
957
947
pax -> height = pax2 -> height ;
958
948
pax -> otherheight = height ;
959
- if ( strcmp ( "USD" , ASSETCHAINS_SYMBOL ) == 0 && strcmp (CURRENCIES [baseids [i ]],ASSETCHAINS_SYMBOL ) == 0 )
949
+ if ( 0 && strcmp (CURRENCIES [baseids [i ]],ASSETCHAINS_SYMBOL ) == 0 )
960
950
printf ("########### %p issuedb %s += %.8f kmdheight.%d %.8f other.%d\n" ,basesp ,CURRENCIES [baseids [i ]],dstr (pax -> fiatoshis ),pax -> height ,dstr (pax -> komodoshis ),pax -> otherheight );
961
951
}
962
952
}
@@ -970,7 +960,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
970
960
} //else printf("opreturn none issued?\n");
971
961
}
972
962
}
973
- else if ( opretbuf [0 ] == 'W' )//&& opretlen >= 38 )
963
+ else if ( height < 236000 && opretbuf [0 ] == 'W' )//&& opretlen >= 38 )
974
964
{
975
965
if ( komodo_baseid ((char * )& opretbuf [opretlen - 4 ]) >= 0 && strcmp (ASSETCHAINS_SYMBOL ,(char * )& opretbuf [opretlen - 4 ]) == 0 )
976
966
{
@@ -1015,7 +1005,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
1015
1005
} // else printf("withdraw %s paxcmp ht.%d %d error value %.8f -> %.8f vs %.8f\n",base,kmdheight,height,dstr(value),dstr(komodoshis),dstr(checktoshis));
1016
1006
// need to allocate pax
1017
1007
}
1018
- else if ( tokomodo != 0 && opretbuf [0 ] == 'A' )
1008
+ else if ( height < 236000 && tokomodo != 0 && opretbuf [0 ] == 'A' )
1019
1009
{
1020
1010
tokomodo = 1 ;
1021
1011
if ( 0 && ASSETCHAINS_SYMBOL [0 ] != 0 )
@@ -1094,7 +1084,7 @@ const char *komodo_opreturn(int32_t height,uint64_t value,uint8_t *opretbuf,int3
1094
1084
} //else printf("n.%d from opreturns\n",n);
1095
1085
//printf("extra.[%d] after %.8f\n",n,dstr(komodo_paxtotal()));
1096
1086
}
1097
- else if ( opretbuf [0 ] == 'x ' )
1087
+ else if ( height < 236000 && opretbuf [0 ] == 'X ' )
1098
1088
{
1099
1089
tokomodo = 1 ;
1100
1090
if ( (n = komodo_issued_opreturn (base ,txids ,vouts ,values ,srcvalues ,kmdheights ,otherheights ,baseids ,rmd160s ,opretbuf ,opretlen ,1 )) > 0 )
0 commit comments