This commit is contained in:
jl777
2016-10-20 05:26:21 -03:00
parent efc416210e
commit 82fecc5389

View File

@@ -186,6 +186,9 @@ struct nutxo_entry { uint256 txhash; uint64_t voutmask; int32_t notaryid; };
struct nutxo_entry NUTXOS[10000]; struct nutxo_entry NUTXOS[10000];
void komodo_nutxoadd(int32_t notaryid,uint256 txhash,uint64_t voutmask,int32_t numvouts); void komodo_nutxoadd(int32_t notaryid,uint256 txhash,uint64_t voutmask,int32_t numvouts);
// add opreturn funcid
// height/pubkey notary lookup
// pricefeeds
int32_t komodo_threshold(uint64_t signedmask) int32_t komodo_threshold(uint64_t signedmask)
{ {
@@ -206,6 +209,7 @@ int32_t komodo_stateupdate(uint8_t notarypubs[][33],uint8_t numnotaries,uint8_t
{ {
while ( (func= fgetc(fp)) != EOF ) while ( (func= fgetc(fp)) != EOF )
{ {
printf("func.(%d %c)\n",func,func);
if ( func == 'P' ) if ( func == 'P' )
{ {
if ( (num= fgetc(fp)) < 64 ) if ( (num= fgetc(fp)) < 64 )
@@ -246,6 +250,7 @@ int32_t komodo_stateupdate(uint8_t notarypubs[][33],uint8_t numnotaries,uint8_t
{ {
if ( notarypubs != 0 && numnotaries > 0 ) if ( notarypubs != 0 && numnotaries > 0 )
{ {
printf("func P[%d]\n",numnotaries);
fputc('P',fp); fputc('P',fp);
fputc(numnotaries,fp); fputc(numnotaries,fp);
if ( fwrite(notarypubs,33,numnotaries,fp) != numnotaries ) if ( fwrite(notarypubs,33,numnotaries,fp) != numnotaries )
@@ -253,6 +258,7 @@ int32_t komodo_stateupdate(uint8_t notarypubs[][33],uint8_t numnotaries,uint8_t
} }
else if ( voutmask != 0 && numvouts > 0 ) else if ( voutmask != 0 && numvouts > 0 )
{ {
printf("func U %d %d\n",numvouts,notaryid);
fputc('U',fp); fputc('U',fp);
fputc(numvouts,fp); fputc(numvouts,fp);
fputc(notaryid,fp); fputc(notaryid,fp);
@@ -263,6 +269,7 @@ int32_t komodo_stateupdate(uint8_t notarypubs[][33],uint8_t numnotaries,uint8_t
} }
else else
{ {
printf("func N ht.%d\n",NOTARIZED_HEIGHT);
fputc('N',fp); fputc('N',fp);
if ( fwrite(&NOTARIZED_HEIGHT,1,sizeof(NOTARIZED_HEIGHT),fp) != sizeof(NOTARIZED_HEIGHT) ) if ( fwrite(&NOTARIZED_HEIGHT,1,sizeof(NOTARIZED_HEIGHT),fp) != sizeof(NOTARIZED_HEIGHT) )
errs++; errs++;