diff --git a/src/cc/gamescc.cpp b/src/cc/gamescc.cpp index 559910642..61efb799b 100644 --- a/src/cc/gamescc.cpp +++ b/src/cc/gamescc.cpp @@ -168,12 +168,13 @@ UniValue games_register(uint64_t txfee,struct CCcontract_info *cp,cJSON *params) int32_t games_eventsign(std::vector &sig,std::vector payload,CPubKey pk) { static secp256k1_context *ctx; - size_t siglen = 74; secp256k1_ecdsa_signature signature; uint8_t privkey[32]; + size_t siglen = 74; secp256k1_ecdsa_signature signature; uint8_t privkey[32]; uint256 hash; if ( ctx == 0 ) ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN); if ( ctx != 0 ) { Myprivkey(privkey); + vcalc_sha256(0,(uint8_t *)&hash,&payload[0],(int32_t)payload.size()); if ( secp256k1_ecdsa_sign(ctx,&signature,(uint8_t *)&hash,privkey,NULL,NULL) > 0 ) { sig.resize(siglen);