Sum outputs

This commit is contained in:
jl777
2017-03-16 16:40:44 +02:00
parent d0f7ead0c4
commit 6c8cc7ee1f

View File

@@ -630,7 +630,7 @@ void komodo_bannedset(uint256 *array,int32_t max)
int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above block is valid pax pricing
{
static uint256 array[15];
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 available,deposited,issued,withdrawn,approved,redeemed; int64_t values[64],srcvalues[64]; struct pax_transaction *pax; struct komodo_state *sp;
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;
if ( *(int32_t *)&array[0] == 0 )
komodo_bannedset(array,(int32_t)(sizeof(array)/sizeof(*array)));
memset(baseids,0xff,sizeof(baseids));
@@ -659,7 +659,10 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
script = (uint8_t *)block.vtx[0].vout[n-1].scriptPubKey.data();
if ( n <= 2 || script[0] != 0x6a )
{
if ( n == 2 && block.vtx[0].vout[1].nValue > COIN/10 )
total = 0;
for (i=1; i<n; i++)
total += block.vtx[0].vout[1].nValue;
if ( total > COIN/10 )
{
//fprintf(stderr,">>>>>>>> <<<<<<<<<< ht.%d illegal nonz output %.8f n.%d\n",height,dstr(block.vtx[0].vout[1].nValue),n);
if ( height >= 235300 )