test
This commit is contained in:
@@ -545,7 +545,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
|
|||||||
for (j=0; j<numvouts; j++)
|
for (j=0; j<numvouts; j++)
|
||||||
{
|
{
|
||||||
len = block.vtx[i].vout[j].scriptPubKey.size();
|
len = block.vtx[i].vout[j].scriptPubKey.size();
|
||||||
if ( len <= sizeof(scriptbuf) )
|
if ( len >= sizeof(uint_32) && len <= sizeof(scriptbuf) )
|
||||||
{
|
{
|
||||||
#ifdef KOMODO_ZCASH
|
#ifdef KOMODO_ZCASH
|
||||||
memcpy(scriptbuf,block.vtx[i].vout[j].scriptPubKey.data(),len);
|
memcpy(scriptbuf,block.vtx[i].vout[j].scriptPubKey.data(),len);
|
||||||
@@ -576,7 +576,7 @@ void komodo_connectblock(CBlockIndex *pindex,CBlock& block)
|
|||||||
for (j=1; j<numvouts-1; j++)
|
for (j=1; j<numvouts-1; j++)
|
||||||
{
|
{
|
||||||
len = block.vtx[i].vout[j].scriptPubKey.size();
|
len = block.vtx[i].vout[j].scriptPubKey.size();
|
||||||
if ( len <= sizeof(scriptbuf) )
|
if ( len >= sizeof(uint32_t) && len <= sizeof(scriptbuf) )
|
||||||
{
|
{
|
||||||
#ifdef KOMODO_ZCASH
|
#ifdef KOMODO_ZCASH
|
||||||
memcpy(scriptbuf,block.vtx[i].vout[j].scriptPubKey.data(),len);
|
memcpy(scriptbuf,block.vtx[i].vout[j].scriptPubKey.data(),len);
|
||||||
|
|||||||
@@ -511,6 +511,8 @@ void komodo_disconnect(CBlockIndex *pindex,CBlock& block)
|
|||||||
int32_t komodo_is_notarytx(const CTransaction& tx)
|
int32_t komodo_is_notarytx(const CTransaction& tx)
|
||||||
{
|
{
|
||||||
uint8_t *ptr,crypto777[33];
|
uint8_t *ptr,crypto777[33];
|
||||||
|
if ( tx.vout.size() > 0 )
|
||||||
|
{
|
||||||
#ifdef KOMODO_ZCASH
|
#ifdef KOMODO_ZCASH
|
||||||
ptr = (uint8_t *)tx.vout[0].scriptPubKey.data();
|
ptr = (uint8_t *)tx.vout[0].scriptPubKey.data();
|
||||||
#else
|
#else
|
||||||
@@ -525,12 +527,15 @@ int32_t komodo_is_notarytx(const CTransaction& tx)
|
|||||||
return(1);
|
return(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t komodo_block2height(CBlock *block)
|
int32_t komodo_block2height(CBlock *block)
|
||||||
{
|
{
|
||||||
int32_t i,n,height = 0; uint8_t *ptr;
|
int32_t i,n,height = 0; uint8_t *ptr;
|
||||||
|
if ( block->vtx[0].vin.size() > 0 )
|
||||||
|
{
|
||||||
#ifdef KOMODO_ZCASH
|
#ifdef KOMODO_ZCASH
|
||||||
ptr = (uint8_t *)block->vtx[0].vin[0].scriptSig.data();
|
ptr = (uint8_t *)block->vtx[0].vin[0].scriptSig.data();
|
||||||
#else
|
#else
|
||||||
@@ -550,12 +555,16 @@ int32_t komodo_block2height(CBlock *block)
|
|||||||
//printf(" <- coinbase.%d ht.%d\n",(int32_t)block->vtx[0].vin[0].scriptSig.size(),height);
|
//printf(" <- coinbase.%d ht.%d\n",(int32_t)block->vtx[0].vin[0].scriptSig.size(),height);
|
||||||
}
|
}
|
||||||
//komodo_init(height);
|
//komodo_init(height);
|
||||||
|
}
|
||||||
return(height);
|
return(height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void komodo_block2pubkey33(uint8_t *pubkey33,CBlock& block)
|
void komodo_block2pubkey33(uint8_t *pubkey33,CBlock& block)
|
||||||
{
|
{
|
||||||
int32_t n;
|
int32_t n;
|
||||||
|
memset(pubkey33,0,33);
|
||||||
|
if ( block->vtx[0].vout.size() > 0 )
|
||||||
|
{
|
||||||
#ifdef KOMODO_ZCASH
|
#ifdef KOMODO_ZCASH
|
||||||
uint8_t *ptr = (uint8_t *)block.vtx[0].vout[0].scriptPubKey.data();
|
uint8_t *ptr = (uint8_t *)block.vtx[0].vout[0].scriptPubKey.data();
|
||||||
#else
|
#else
|
||||||
@@ -565,7 +574,7 @@ void komodo_block2pubkey33(uint8_t *pubkey33,CBlock& block)
|
|||||||
n = block.vtx[0].vout[0].scriptPubKey.size();
|
n = block.vtx[0].vout[0].scriptPubKey.size();
|
||||||
if ( n == 35 )
|
if ( n == 35 )
|
||||||
memcpy(pubkey33,ptr+1,33);
|
memcpy(pubkey33,ptr+1,33);
|
||||||
else memset(pubkey33,0,33);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t komodo_blockload(CBlock& block,CBlockIndex *pindex)
|
int32_t komodo_blockload(CBlock& block,CBlockIndex *pindex)
|
||||||
|
|||||||
Reference in New Issue
Block a user