From c9a6b6218a3878d6053c3eee190aeda470e51250 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 8 Jul 2019 20:16:57 -1100 Subject: [PATCH] +print --- src/komodo_nSPV.h | 1 + src/komodo_nSPV_wallet.h | 3 ++- src/script/sign.cpp | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/komodo_nSPV.h b/src/komodo_nSPV.h index 77c352659..72a23d23f 100644 --- a/src/komodo_nSPV.h +++ b/src/komodo_nSPV.h @@ -53,6 +53,7 @@ #define NSPV_BROADCASTRESP 0x0d int32_t NSPV_gettransaction(int32_t skipvalidation,int32_t vout,uint256 txid,int32_t height,CTransaction &tx); +extern uint256 SIG_TXHASH; int32_t iguana_rwbuf(int32_t rwflag,uint8_t *serialized,uint16_t len,uint8_t *buf) { diff --git a/src/komodo_nSPV_wallet.h b/src/komodo_nSPV_wallet.h index 397dbe625..a53ec77b2 100644 --- a/src/komodo_nSPV_wallet.h +++ b/src/komodo_nSPV_wallet.h @@ -135,8 +135,9 @@ bool NSPV_SignTx(CMutableTransaction &mtx,int32_t vini,int64_t utxovalue,const C if ( ProduceSignature(TransactionSignatureCreator(&keystore,&txNewConst,vini,utxovalue,SIGHASH_ALL),scriptPubKey,sigdata,NSPV_BRANCHID) != 0 ) { UpdateTransaction(mtx,vini,sigdata); + fprintf(stderr,"SIGTXHASH %s vini.%d %.8f\n",SIGTXHASH.GetHex().c_str(),vini,(double)utxovalue/COIN); return(true); - } // else fprintf(stderr,"signing error for SignTx vini.%d %.8f\n",vini,(double)utxovalue/COIN); + } else fprintf(stderr,"sigerr SIGTXHASH %s vini.%d %.8f\n",SIGTXHASH.GetHex().c_str(),vini,(double)utxovalue/COIN); return(false); } diff --git a/src/script/sign.cpp b/src/script/sign.cpp index 685018828..1865d8e35 100644 --- a/src/script/sign.cpp +++ b/src/script/sign.cpp @@ -35,6 +35,7 @@ using namespace std; typedef vector valtype; extern uint8_t ASSETCHAINS_TXPOW; +uint256 SIG_TXHASH; TransactionSignatureCreator::TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, int nHashTypeIn) : BaseSignatureCreator(keystoreIn), txTo(txToIn), nIn(nInIn), nHashType(nHashTypeIn), amount(amountIn), checker(txTo, nIn, amountIn) {} @@ -52,7 +53,7 @@ bool TransactionSignatureCreator::CreateSig(std::vector& vchSig, } catch (logic_error ex) { return false; } - + TXHASH = hash; if (scriptCode.IsPayToCryptoCondition()) { CC *cc = (CC *)extraData;