This commit is contained in:
jl777
2019-07-07 01:55:27 -11:00
parent 27111cb1a3
commit 24c3329916
2 changed files with 7 additions and 7 deletions

View File

@@ -416,7 +416,7 @@ int32_t NSPV_pubkeysextract(uint8_t pubkeys[64][33],CTransaction tx,uint8_t elec
return(numsigs); return(numsigs);
} }
uint256 NSPV_opretextract(int32_t *heightp,uint256 *blockhashp,char *symbol,std::vector<uint8_t> opret) uint256 NSPV_opretextract(int32_t *heightp,uint256 *blockhashp,char *symbol,std::vector<uint8_t> opret,uint256 txid)
{ {
uint256 desttxid; int32_t i; uint256 desttxid; int32_t i;
iguana_rwnum(0,&opret[32],sizeof(*heightp),heightp); iguana_rwnum(0,&opret[32],sizeof(*heightp),heightp);
@@ -424,6 +424,7 @@ uint256 NSPV_opretextract(int32_t *heightp,uint256 *blockhashp,char *symbol,std:
((uint8_t *)blockhashp)[i] = opret[i]; ((uint8_t *)blockhashp)[i] = opret[i];
for (i=0; i<32; i++) for (i=0; i<32; i++)
((uint8_t *)&desttxid)[i] = opret[4 + 32 + i]; ((uint8_t *)&desttxid)[i] = opret[4 + 32 + i];
fprintf(stderr," ntzht.%d %s <- txid.%s size.%d\n",*heightp,(*blockhashp).GetHex().c_str(),(txid).GetHex().c_str(),(int32_t)opret.size());
return(desttxid); return(desttxid);
} }
@@ -437,14 +438,13 @@ int32_t NSPV_notarizationextract(int32_t *heightp,uint256 *blockhashp,uint256 *t
numsigs = NSPV_pubkeysextract(sigkeys,tx,elected); numsigs = NSPV_pubkeysextract(sigkeys,tx,elected);
GetOpReturnData(tx.vout[1].scriptPubKey,opret); GetOpReturnData(tx.vout[1].scriptPubKey,opret);
if ( opret.size() >= 32*2+4*2 ) if ( opret.size() >= 32*2+4*2 )
*desttxidp = NSPV_opretextract(heightp,blockhashp,symbol,opret); *desttxidp = NSPV_opretextract(heightp,blockhashp,symbol,opret,tx.GetHash());
/*{ /*{
int z; int z;
for (z=0; z<68; z++) for (z=0; z<68; z++)
fprintf(stderr,"%02x",opret[z]); fprintf(stderr,"%02x",opret[z]);
}*/ }*/
*txidp = tx.GetHash(); *txidp = tx.GetHash();
fprintf(stderr," ntzht.%d %s <- txid.%s size.%d\n",*heightp,(*blockhashp).GetHex().c_str(),(*txidp).GetHex().c_str(),(int32_t)opret.size());
return(0); return(0);
} else return(-1); } else return(-1);
} }

View File

@@ -50,8 +50,8 @@ int32_t komodo_notarized_bracket(uint256 txids[2],int32_t txidhts[2],uint256 des
if ( !GetTransaction(txids[0],tx,hashBlock,false) || tx.vout.size() < 2 ) if ( !GetTransaction(txids[0],tx,hashBlock,false) || tx.vout.size() < 2 )
return(-2); return(-2);
GetOpReturnData(tx.vout[1].scriptPubKey,opret); GetOpReturnData(tx.vout[1].scriptPubKey,opret);
if ( opret.size() >= 32*2+4 ) //if ( opret.size() >= 32*2+4 )
desttxids[0] = NSPV_opretextract(&ntzheights[0],&bhash0,symbol,opret); desttxids[0] = NSPV_opretextract(&ntzheights[0],&bhash0,symbol,opret,txids[0]);
/*desttxids[0] = NSPV_opretextract(&ntzheights[0],&bhash0,symbol,E_MARSHAL(ss << nota.second)); /*desttxids[0] = NSPV_opretextract(&ntzheights[0],&bhash0,symbol,E_MARSHAL(ss << nota.second));
//if ( height != 2668 ) //if ( height != 2668 )
@@ -71,8 +71,8 @@ int32_t komodo_notarized_bracket(uint256 txids[2],int32_t txidhts[2],uint256 des
if ( !GetTransaction(txids[1],tx,hashBlock,false) || tx.vout.size() < 2 ) if ( !GetTransaction(txids[1],tx,hashBlock,false) || tx.vout.size() < 2 )
return(-2); return(-2);
GetOpReturnData(tx.vout[1].scriptPubKey,opret); GetOpReturnData(tx.vout[1].scriptPubKey,opret);
if ( opret.size() >= 32*2+4 ) //if ( opret.size() >= 32*2+4 )
desttxids[1] = NSPV_opretextract(&ntzheights[1],&bhash1,symbol,opret); desttxids[1] = NSPV_opretextract(&ntzheights[1],&bhash1,symbol,opret,txids[1]);
//desttxids[1] = NSPV_opretextract(&ntzheights[1],&bhash1,symbol,E_MARSHAL(ss << nota.second)); //desttxids[1] = NSPV_opretextract(&ntzheights[1],&bhash1,symbol,E_MARSHAL(ss << nota.second));
} }
//fprintf(stderr,"prev.(%s -> ht.%d %s) next.(%s -> ht.%d %s)\n",txids[0].GetHex().c_str(),ntzheights[0],bhash0.GetHex().c_str(),txids[1].GetHex().c_str(),ntzheights[1],bhash1.GetHex().c_str()); //fprintf(stderr,"prev.(%s -> ht.%d %s) next.(%s -> ht.%d %s)\n",txids[0].GetHex().c_str(),ntzheights[0],bhash0.GetHex().c_str(),txids[1].GetHex().c_str(),ntzheights[1],bhash1.GetHex().c_str());