Egret
This commit is contained in:
@@ -46,7 +46,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
auto consensusBranchId = CurrentEpochBranchId(chainActive.Height() + 1, Params().GetConsensus());
|
auto consensusBranchId = CurrentEpochBranchId(chainActive.Height() + 1, Params().GetConsensus());
|
||||||
CTransaction vintx; std::string hex; CPubKey globalpk; uint256 hashBlock; uint64_t mask=0,nmask=0,vinimask=0;
|
CTransaction vintx; std::string hex; CPubKey globalpk; uint256 hashBlock; uint64_t mask=0,nmask=0,vinimask=0;
|
||||||
int64_t utxovalues[CC_MAXVINS],change,normalinputs=0,totaloutputs=0,normaloutputs=0,totalinputs=0,normalvins=0,ccvins=0;
|
int64_t utxovalues[CC_MAXVINS],change,normalinputs=0,totaloutputs=0,normaloutputs=0,totalinputs=0,normalvins=0,ccvins=0;
|
||||||
int32_t i,flag,utxovout,n,err = 0;
|
int32_t i,flag,mgret,utxovout,n,err = 0;
|
||||||
char myaddr[64], destaddr[64], unspendable[64], mytokensaddr[64], mysingletokensaddr[64], unspendabletokensaddr[64],CC1of2CCaddr[64];
|
char myaddr[64], destaddr[64], unspendable[64], mytokensaddr[64], mysingletokensaddr[64], unspendabletokensaddr[64],CC1of2CCaddr[64];
|
||||||
uint8_t *privkey, myprivkey[32], unspendablepriv[32], /*tokensunspendablepriv[32],*/ *msg32 = 0;
|
uint8_t *privkey, myprivkey[32], unspendablepriv[32], /*tokensunspendablepriv[32],*/ *msg32 = 0;
|
||||||
CC *mycond=0, *othercond=0, *othercond2=0,*othercond4=0, *othercond3=0, *othercond1of2=NULL, *othercond1of2tokens = NULL, *cond=0, *condCC2=0,*mytokenscond = NULL, *mysingletokenscond = NULL, *othertokenscond = NULL;
|
CC *mycond=0, *othercond=0, *othercond2=0,*othercond4=0, *othercond3=0, *othercond1of2=NULL, *othercond1of2tokens = NULL, *cond=0, *condCC2=0,*mytokenscond = NULL, *mysingletokenscond = NULL, *othertokenscond = NULL;
|
||||||
@@ -118,7 +118,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
for (i=0; i<n; i++)
|
for (i=0; i<n; i++)
|
||||||
{
|
{
|
||||||
if (i==0 && mtx.vin[i].prevout.n==10e8) continue;
|
if (i==0 && mtx.vin[i].prevout.n==10e8) continue;
|
||||||
if ( myGetTransaction(mtx.vin[i].prevout.hash,vintx,hashBlock) != 0 )
|
if ( (mgret= myGetTransaction(mtx.vin[i].prevout.hash,vintx,hashBlock)) != 0 )
|
||||||
{
|
{
|
||||||
utxovout = mtx.vin[i].prevout.n;
|
utxovout = mtx.vin[i].prevout.n;
|
||||||
utxovalues[i] = vintx.vout[utxovout].nValue;
|
utxovalues[i] = vintx.vout[utxovout].nValue;
|
||||||
@@ -133,7 +133,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
{
|
{
|
||||||
mask |= (1LL << i);
|
mask |= (1LL << i);
|
||||||
}
|
}
|
||||||
} else fprintf(stderr,"FinalizeCCTx couldnt find %s\n",mtx.vin[i].prevout.hash.ToString().c_str());
|
} else fprintf(stderr,"FinalizeCCTx couldnt find %s mgret.%d\n",mtx.vin[i].prevout.hash.ToString().c_str(),mgret);
|
||||||
}
|
}
|
||||||
nmask = (1LL << n) - 1;
|
nmask = (1LL << n) - 1;
|
||||||
if ( 0 && (mask & nmask) != (CCmask & nmask) )
|
if ( 0 && (mask & nmask) != (CCmask & nmask) )
|
||||||
@@ -151,7 +151,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
{
|
{
|
||||||
if (i==0 && mtx.vin[i].prevout.n==10e8)
|
if (i==0 && mtx.vin[i].prevout.n==10e8)
|
||||||
continue;
|
continue;
|
||||||
if ( myGetTransaction(mtx.vin[i].prevout.hash,vintx,hashBlock) != 0 )
|
if ( (mgret= myGetTransaction(mtx.vin[i].prevout.hash,vintx,hashBlock)) != 0 )
|
||||||
{
|
{
|
||||||
utxovout = mtx.vin[i].prevout.n;
|
utxovout = mtx.vin[i].prevout.n;
|
||||||
if ( vintx.vout[utxovout].scriptPubKey.IsPayToCryptoCondition() == 0 )
|
if ( vintx.vout[utxovout].scriptPubKey.IsPayToCryptoCondition() == 0 )
|
||||||
@@ -297,7 +297,7 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran
|
|||||||
return("");
|
return("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else fprintf(stderr,"FinalizeCCTx couldnt find %s\n",mtx.vin[i].prevout.hash.ToString().c_str());
|
} else fprintf(stderr,"FinalizeCCTx2 couldnt find %s mgret.%d\n",mtx.vin[i].prevout.hash.ToString().c_str(),mgret);
|
||||||
}
|
}
|
||||||
if ( mycond != 0 )
|
if ( mycond != 0 )
|
||||||
cc_free(mycond);
|
cc_free(mycond);
|
||||||
|
|||||||
@@ -452,9 +452,9 @@ bool Myprivkey(uint8_t myprivkey[])
|
|||||||
{
|
{
|
||||||
vchSecret = DecodeSecret(NSPV_wifstr);
|
vchSecret = DecodeSecret(NSPV_wifstr);
|
||||||
memcpy(myprivkey,vchSecret.begin(),32);
|
memcpy(myprivkey,vchSecret.begin(),32);
|
||||||
for (i=0; i<32; i++)
|
//for (i=0; i<32; i++)
|
||||||
fprintf(stderr,"%02x",myprivkey[i]);
|
// fprintf(stderr,"%02x",myprivkey[i]);
|
||||||
fprintf(stderr," myprivkey %s\n",NSPV_wifstr);
|
//fprintf(stderr," myprivkey %s\n",NSPV_wifstr);
|
||||||
memset((uint8_t *)vchSecret.begin(),0,32);
|
memset((uint8_t *)vchSecret.begin(),0,32);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
// todo:
|
// todo:
|
||||||
|
|
||||||
// CC signing
|
// myprivkey, scrub all destination buffers
|
||||||
|
|
||||||
// headers "sync" make sure it connects to prior blocks to notarization. use getinfo hdrht to get missing hdrs
|
// headers "sync" make sure it connects to prior blocks to notarization. use getinfo hdrht to get missing hdrs
|
||||||
|
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ int32_t NSPV_validatehdrs(struct NSPV_ntzsproofresp *ptr)
|
|||||||
int32_t NSPV_gettransaction(int32_t skipvalidation,int32_t vout,uint256 txid,int32_t height,CTransaction &tx,int64_t extradata,uint32_t tiptime,int64_t &rewardsum)
|
int32_t NSPV_gettransaction(int32_t skipvalidation,int32_t vout,uint256 txid,int32_t height,CTransaction &tx,int64_t extradata,uint32_t tiptime,int64_t &rewardsum)
|
||||||
{
|
{
|
||||||
struct NSPV_txproof *ptr; int32_t i,offset,retval = 0; int64_t rewards = 0; uint32_t nLockTime; std::vector<uint8_t> proof;
|
struct NSPV_txproof *ptr; int32_t i,offset,retval = 0; int64_t rewards = 0; uint32_t nLockTime; std::vector<uint8_t> proof;
|
||||||
|
fprintf(stderr,"NSPV_gettx %s/v%d ht.%d\n",txid.GetHex().c_str(),vout,height);
|
||||||
if ( (ptr= NSPV_txproof_find(txid)) == 0 )
|
if ( (ptr= NSPV_txproof_find(txid)) == 0 )
|
||||||
{
|
{
|
||||||
NSPV_txproof(vout,txid,height);
|
NSPV_txproof(vout,txid,height);
|
||||||
|
|||||||
@@ -2236,7 +2236,7 @@ bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlo
|
|||||||
txheight = NSPV_U.U.utxos[i].height;
|
txheight = NSPV_U.U.utxos[i].height;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
retval = NSPV_gettransaction(1,vout,hash,txheight,txOut,0,0,rewardsum);
|
retval = NSPV_gettransaction(txheight == 0,vout,hash,txheight,txOut,0,0,rewardsum);
|
||||||
return(retval == 0);
|
return(retval == 0);
|
||||||
}
|
}
|
||||||
// need a GetTransaction without lock so the validation code for assets can run without deadlock
|
// need a GetTransaction without lock so the validation code for assets can run without deadlock
|
||||||
|
|||||||
Reference in New Issue
Block a user