From 2e32decd47bdbc5aa72f99af7eb3714abeaf1b06 Mon Sep 17 00:00:00 2001 From: jl777 Date: Tue, 4 Sep 2018 03:02:56 -1100 Subject: [PATCH] Test --- src/cc/oracles.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cc/oracles.cpp b/src/cc/oracles.cpp index 9a2ee45db..679cef14b 100644 --- a/src/cc/oracles.cpp +++ b/src/cc/oracles.cpp @@ -162,6 +162,7 @@ uint8_t DecodeOraclesData(const CScript &scriptPubKey,uint256 &oracletxid,uint25 CPubKey OracleBatonPk(char *batonaddr,struct CCcontract_info *cp,CPubKey mypk) { static secp256k1_context *ctx; + size_t clen = CPubKey::PUBLIC_KEY_SIZE; secp256k1_pubkey pubkey; CPubKey batonpk; uint8_t priv[32]; int32_t i; if ( ctx == 0 ) ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN); @@ -170,7 +171,8 @@ CPubKey OracleBatonPk(char *batonaddr,struct CCcontract_info *cp,CPubKey mypk) cp->unspendablepriv2[i] = (priv[i] ^ cp->CCpriv[i]); if ( secp256k1_ec_pubkey_create(ctx,&pubkey,cp->unspendablepriv2) != 0 ) { - batonpk = cp->unspendablepk2 = pubkey; + secp256k1_ec_pubkey_serialize(ctx,(unsigned char*)batonpk.begin(),&clen,&pubkey,SECP256K1_EC_COMPRESSED); + cp->unspendablepk2 = batonpk; Getscriptaddress(batonaddr,CScript() << ParseHex(HexStr(batonpk)) << OP_CHECKSIG); fprintf(stderr,"batonpk.(%s)\n",(char *)HexStr(batonpk).c_str()); strcpy(cp->unspendableaddr2,batonaddr);