Test
This commit is contained in:
@@ -111,13 +111,13 @@ void komodo_kvupdate(uint8_t *opretbuf,int32_t opretlen,uint64_t value)
|
|||||||
if ( keylen+13 > opretlen )
|
if ( keylen+13 > opretlen )
|
||||||
{
|
{
|
||||||
static uint32_t counter;
|
static uint32_t counter;
|
||||||
if ( ++counter < 1 )
|
if ( ++counter < 100 )
|
||||||
printf("komodo_kvupdate: keylen.%d + 13 > opretlen.%d, this can be ignored\n",keylen,opretlen);
|
fprintf(stderr,"komodo_kvupdate: keylen.%d + 13 > opretlen.%d, this can be ignored\n",keylen,opretlen);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
valueptr = &key[keylen];
|
valueptr = &key[keylen];
|
||||||
fee = komodo_kvfee(flags,opretlen,keylen);
|
fee = komodo_kvfee(flags,opretlen,keylen);
|
||||||
//printf("fee %.8f vs %.8f flags.%d keylen.%d valuesize.%d height.%d (%02x %02x %02x) (%02x %02x %02x)\n",(double)fee/COIN,(double)value/COIN,flags,keylen,valuesize,height,key[0],key[1],key[2],valueptr[0],valueptr[1],valueptr[2]);
|
printf("fee %.8f vs %.8f flags.%d keylen.%d valuesize.%d height.%d (%02x %02x %02x) (%02x %02x %02x)\n",(double)fee/COIN,(double)value/COIN,flags,keylen,valuesize,height,key[0],key[1],key[2],valueptr[0],valueptr[1],valueptr[2]);
|
||||||
if ( value >= fee )
|
if ( value >= fee )
|
||||||
{
|
{
|
||||||
coresize = (int32_t)(sizeof(flags)+sizeof(height)+sizeof(keylen)+sizeof(valuesize)+keylen+valuesize+1);
|
coresize = (int32_t)(sizeof(flags)+sizeof(height)+sizeof(keylen)+sizeof(valuesize)+keylen+valuesize+1);
|
||||||
@@ -142,7 +142,7 @@ void komodo_kvupdate(uint8_t *opretbuf,int32_t opretlen,uint64_t value)
|
|||||||
{
|
{
|
||||||
if ( komodo_kvsigverify(keyvalue,keylen+refvaluesize,refpubkey,sig) < 0 )
|
if ( komodo_kvsigverify(keyvalue,keylen+refvaluesize,refpubkey,sig) < 0 )
|
||||||
{
|
{
|
||||||
printf("komodo_kvsigverify error [%d]\n",coresize-13);
|
fprintf(stderr,"komodo_kvsigverify error [%d]\n",coresize-13);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -194,7 +194,7 @@ void komodo_kvupdate(uint8_t *opretbuf,int32_t opretlen,uint64_t value)
|
|||||||
ptr->height = height;
|
ptr->height = height;
|
||||||
ptr->flags = flags; // jl777 used to or in KVPROTECTED
|
ptr->flags = flags; // jl777 used to or in KVPROTECTED
|
||||||
portable_mutex_unlock(&KOMODO_KV_mutex);
|
portable_mutex_unlock(&KOMODO_KV_mutex);
|
||||||
} else fprintf(stderr,"size mismatch %d vs %d\n",opretlen,coresize);
|
} else fprintf(stderr,"KV update size mismatch %d vs %d\n",opretlen,coresize);
|
||||||
} else fprintf(stderr,"not enough fee\n");
|
} else fprintf(stderr,"not enough fee\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user