This commit is contained in:
jl777
2018-09-21 23:33:11 -11:00
parent 2682c88a7a
commit 69d86d7782
2 changed files with 5 additions and 5 deletions

View File

@@ -198,15 +198,15 @@ const char *Notaries_elected1[][2] =
{"xrobesx_NA", "03f0cc6d142d14a40937f12dbd99dbd9021328f45759e26f1877f2a838876709e1" },
};
int32_t komodo_isnotaryvout(CScript scriptPubKey) // from ac_private chains only
int32_t komodo_isnotaryvout(uint8_t *script) // from ac_private chains only
{
uint8_t pubkey33[33],*ptr = scriptPubKey.data(); int32_t i;
if ( scriptPubKey.size() == 35 && ptr[0] == 33 && ptr[34] == 0xac )
uint8_t pubkey33[33]; int32_t i;
if ( script[0] == 33 && script[34] == 0xac )
{
for (i=0; i<sizeof(Notaries_elected1)/sizeof(*Notaries_elected1); i++)
{
decode_hex(pubkey33,33,(char *)Notaries_elected1[i][1]);
if ( memcmp(ptr+1,pubkey33,33) == 0 )
if ( memcmp(script+1,pubkey33,33) == 0 )
return(1);
}
}

View File

@@ -1121,7 +1121,7 @@ bool CheckTransactionWithoutProofVerification(const CTransaction& tx, CValidatio
fprintf(stderr,"private chain nValue %.8f iscoinbase.%d\n",(double)txout.nValue/COIN,iscoinbase);
if ( (txout.nValue > 0 && iscoinbase == 0) || tx.GetJoinSplitValueOut() > 0 )
{
if ( komodo_isnotaryvout(txout.scriptPubKey) == 0 )
if ( txout.scriptPubKey.size() == 35 && komodo_isnotaryvout((uint8_t *)txout.scriptPubKey.data()) == 0 )
return state.DoS(100, error("CheckTransaction(): this is a private chain, no public allowed"),REJECT_INVALID, "bad-txns-acprivacy-chain");
}
}