diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index ab21cdc3b..89d918037 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -280,15 +280,15 @@ fprintf(stderr,"FinalizeCCTx() matched %s cp->tokens1of2addr!\n", cp->tokens1of2 } uint256 sighash = SignatureHash(CCPubKey(cond), mtx, i, SIGHASH_ALL,utxovalues[i],consensusBranchId, &txdata); int32_t z; + for (z=0; z<32; z++) + fprintf(stderr,"%02x",privkey[z]); + fprintf(stderr," privkey, "); for (z=0; z<32; z++) fprintf(stderr,"%02x",((uint8_t *)sighash.begin())[z]); fprintf(stderr," sighash [%d] %.8f %x\n",i,(double)utxovalues[i]/COIN,consensusBranchId); if ( cc_signTreeSecp256k1Msg32(cond,privkey,sighash.begin()) != 0 ) { - //for (z=0; z<32; z++) - // fprintf(stderr,"%02x",privkey[z]); - //fprintf(stderr," signed with privkey\n"); - mtx.vin[i].scriptSig = CCSig(cond); + mtx.vin[i].scriptSig = CCSig(cond); } else { diff --git a/src/cryptoconditions/src/secp256k1.c b/src/cryptoconditions/src/secp256k1.c index 0c1f2db79..a16115bb8 100644 --- a/src/cryptoconditions/src/secp256k1.c +++ b/src/cryptoconditions/src/secp256k1.c @@ -193,7 +193,7 @@ int cc_signTreeSecp256k1Msg32(CC *cond, const unsigned char *privateKey, const u // serialize pubkey //unsigned char *publicKey = calloc(1, SECP256K1_PK_SIZE); - unsigned char publicKeySECP256K1_PK_SIZE]; + unsigned char publicKey[SECP256K1_PK_SIZE]; size_t ol = SECP256K1_PK_SIZE; secp256k1_ec_pubkey_serialize(ec_ctx_verify, publicKey, &ol, &spk, SECP256K1_EC_COMPRESSED); {