@ -653,7 +653,7 @@ void komodo_passport_iteration();
int32_t komodo_check_deposit ( int32_t height , const CBlock & block ) // verify above block is valid pax pricing
{
static uint256 array [ 64 ] ; static int32_t numbanned , indallvouts ;
int32_t i , j , k , n , ht , baseid , txn_count , activation , num , opretlen , offset = 1 , errs = 0 , matched = 0 , kmdheights [ 256 ] , otherheights [ 256 ] ; uint256 hash , txids [ 256 ] ; char symbol [ KOMODO_ASSETCHAIN_MAXLEN ] , base [ KOMODO_ASSETCHAIN_MAXLEN ] ; uint16_t vouts [ 256 ] ; int8_t baseids [ 256 ] ; uint8_t * script , opcode , rmd160s [ 256 * 20 ] ; uint64_t total , available , deposited , issued , withdrawn , approved , redeemed , checktoshis , seed ; int64_t values [ 256 ] , srcvalues [ 256 ] ; struct pax_transaction * pax ; struct komodo_state * sp ;
int32_t i , j , k , n , ht , baseid , txn_count , activation , num , opretlen , offset = 1 , errs = 0 , matched = 0 , kmdheights [ 256 ] , otherheights [ 256 ] ; uint256 hash , txids [ 256 ] ; char symbol [ KOMODO_ASSETCHAIN_MAXLEN ] , base [ KOMODO_ASSETCHAIN_MAXLEN ] ; uint16_t vouts [ 256 ] ; int8_t baseids [ 256 ] ; uint8_t * script , opcode , rmd160s [ 256 * 20 ] ; uint64_t total , subsidy , available , deposited , issued , withdrawn , approved , redeemed , checktoshis , seed ; int64_t values [ 256 ] , srcvalues [ 256 ] ; struct pax_transaction * pax ; struct komodo_state * sp ;
activation = 235300 ;
if ( * ( int32_t * ) & array [ 0 ] = = 0 )
numbanned = komodo_bannedset ( & indallvouts , array , ( int32_t ) ( sizeof ( array ) / sizeof ( * array ) ) ) ;
@ -721,6 +721,9 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
}
if ( ASSETCHAINS_SYMBOL [ 0 ] ! = 0 & & ASSETCHAINS_COMMISSION ! = 0 )
{
script = ( uint8_t * ) block . vtx [ 0 ] . vout [ 0 ] . scriptPubKey . data ( ) ;
if ( script [ 0 ] ! = 33 | | script [ 34 ] ! = OP_CHECKSIG | | memcmp ( script + 1 , ASSETCHAINS_OVERRIDE_PUBKEY33 , 33 ) ! = 0 )
return ( - 1 ) ;
total = 0 ;
for ( i = 1 ; i < txn_count ; i + + )
{
@ -730,12 +733,8 @@ int32_t komodo_check_deposit(int32_t height,const CBlock& block) // verify above
}
if ( ( checktoshis = ( total * ASSETCHAINS_COMMISSION ) / COIN ) ! = 0 )
{
if ( block . vtx [ 0 ] . vout . size ( ) ! = 2 | | block . vtx [ 0 ] . vout [ 1 ] . nValue ! = checktoshis )
return ( - 1 ) ;
if ( block . vtx [ 0 ] . vout [ 1 ] . scriptPubKey . size ( ) ! = 35 )
return ( - 1 ) ;
script = ( uint8_t * ) block . vtx [ 0 ] . vout [ 1 ] . scriptPubKey . data ( ) ;
if ( script [ 0 ] ! = 33 | | script [ 34 ] ! = OP_CHECKSIG | | memcmp ( script + 1 , ASSETCHAINS_OVERRIDE_PUBKEY33 , 33 ) ! = 0 )
subsidy = GetBlockSubsidy ( height , chainparams . GetConsensus ( ) ) ;
if ( block . vtx [ 0 ] . vout . size ( ) ! = 1 | | block . vtx [ 0 ] . vout [ 0 ] . nValue ! = checktoshis + subsidy )
return ( - 1 ) ;
}
}