change array to non static and remove init
This commit is contained in:
22
src/main.cpp
22
src/main.cpp
@@ -1047,20 +1047,16 @@ bool CheckTransaction(const CTransaction& tx, CValidationState &state,
|
||||
|
||||
int32_t komodo_isnotaryvout(char *coinaddr) // from ac_private chains only
|
||||
{
|
||||
static int32_t didinit; static char notaryaddrs[num_notaries_STAKED1 + 1][64];
|
||||
char notaryaddrs[num_notaries_STAKED1 + 1][64];
|
||||
int32_t i;
|
||||
if ( didinit == 0 )
|
||||
{
|
||||
uint8_t pubkey33[33];
|
||||
for (i=0; i<=num_notaries_STAKED1; i++)
|
||||
{
|
||||
if ( i < num_notaries_STAKED1 )
|
||||
decode_hex(pubkey33,33,(char *)notaries_STAKED1[i][1]);
|
||||
else decode_hex(pubkey33,33,(char *)CRYPTO777_PUBSECPSTR);
|
||||
pubkey2addr((char *)notaryaddrs[i],(uint8_t *)pubkey33);
|
||||
}
|
||||
didinit = 1;
|
||||
}
|
||||
uint8_t pubkey33[33];
|
||||
for (i=0; i<=num_notaries_STAKED1; i++)
|
||||
{
|
||||
if ( i < num_notaries_STAKED1 )
|
||||
decode_hex(pubkey33,33,(char *)notaries_STAKED1[i][1]);
|
||||
else decode_hex(pubkey33,33,(char *)CRYPTO777_PUBSECPSTR);
|
||||
pubkey2addr((char *)notaryaddrs[i],(uint8_t *)pubkey33);
|
||||
}
|
||||
for (i=0; i<=num_notaries_STAKED1; i++)
|
||||
if ( strcmp(coinaddr,notaryaddrs[i]) == 0 )
|
||||
return(1);
|
||||
|
||||
Reference in New Issue
Block a user