From ad4d9210712dac2f57cd9bd86fe572b641f13bb3 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 18 Aug 2018 01:27:42 -1100 Subject: [PATCH] +print --- src/cryptoconditions/src/cryptoconditions.c | 5 +++++ src/script/interpreter.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/cryptoconditions/src/cryptoconditions.c b/src/cryptoconditions/src/cryptoconditions.c index b58d7a70c..011995566 100644 --- a/src/cryptoconditions/src/cryptoconditions.c +++ b/src/cryptoconditions/src/cryptoconditions.c @@ -232,12 +232,15 @@ int cc_verify(const struct CC *cond, const unsigned char *msg, size_t msgLength, const unsigned char *condBin, size_t condBinLength, VerifyEval verifyEval, void *evalContext) { unsigned char targetBinary[1000]; + fprintf(stderr,"in cc_verify cond.%p msg.%p[%d] dohash.%d condbin.%p[%d]\n",cond,msg,(int32_t)msgLength,doHashMsg,condBin,(int32_t)condBinLength); const size_t binLength = cc_conditionBinary(cond, targetBinary); if (0 != memcmp(condBin, targetBinary, binLength)) { + fprintf(stderr,"cc_verify error A\n"); return 0; } if (!cc_ed25519VerifyTree(cond, msg, msgLength)) { + fprintf(stderr,"cc_verify error B\n"); return 0; } @@ -246,10 +249,12 @@ int cc_verify(const struct CC *cond, const unsigned char *msg, size_t msgLength, else memcpy(msgHash, msg, 32); if (!cc_secp256k1VerifyTreeMsg32(cond, msgHash)) { + fprintf(stderr,"cc_verify error C\n"); return 0; } if (!cc_verifyEval(cond, verifyEval, evalContext)) { + fprintf(stderr,"cc_verify error D\n"); return 0; } return 1; diff --git a/src/script/interpreter.cpp b/src/script/interpreter.cpp index e12e3a457..c9bf1b1ab 100644 --- a/src/script/interpreter.cpp +++ b/src/script/interpreter.cpp @@ -1326,7 +1326,7 @@ int TransactionSignatureChecker::CheckCryptoCondition( fprintf(stderr,"checker.%p\n",(TransactionSignatureChecker*)checker); return ((TransactionSignatureChecker*)checker)->CheckEvalCondition(cond); }; - + fprintf(stderr,"non-checker path\n"); int out = cc_verify(cond, (const unsigned char*)&sighash, 32, 0, condBin.data(), condBin.size(), eval, (void*)this); fprintf(stderr,"out.%d from cc_verify\n",(int32_t)out);