From e32a6260d98912c538e9c434ca0c436ff22b323c Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 8 Jul 2019 21:38:14 -1100 Subject: [PATCH] Test --- src/komodo_nSPV.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/komodo_nSPV.h b/src/komodo_nSPV.h index 67b224b8f..03d1f2208 100644 --- a/src/komodo_nSPV.h +++ b/src/komodo_nSPV.h @@ -435,7 +435,7 @@ bool NSPV_SignTx(CMutableTransaction &mtx,int32_t vini,int64_t utxovalue,const C int32_t NSPV_newnotariescount(CTransaction tx,uint8_t elected[64][33]) { - CPubKey pubkeys[64]; uint8_t *ptr; CScript scriptPubKeys[64]; CMutableTransaction mtx(tx); int32_t vini,j,numsigs = 0; + CPubKey pubkeys[64]; uint8_t *ptr; CScript scriptPubKeys[64]; CMutableTransaction mtx(tx); int32_t vini,j,siglen,numsigs = 0; for (j=0; j<64; j++) { pubkeys[j] = buf2pk(elected[j]); @@ -445,14 +445,18 @@ int32_t NSPV_newnotariescount(CTransaction tx,uint8_t elected[64][33]) { ptr = (uint8_t *)&tx.vin[vini].scriptSig; std::vector vchSig; - vchSig.resize(tx.vin[vini].scriptSig.size()-2); + siglen = ptr[16]; + vchSig.resize(siglen); for (j=0; j 0 && j < tx.vin[vini].scriptSig.size()-1 ) - vchSig[j-1] = ptr[j]; + if ( j > 17 && j < 17+siglen ) + vchSig[j-17] = ptr[j]; fprintf(stderr,"%02x",ptr[j]); } - fprintf(stderr," sig.%d\n",vini); + fprintf(stderr," sig.%d siglen.%d\n",vini,siglen); + for (j=0; j