-const
This commit is contained in:
@@ -200,7 +200,7 @@ uint8_t DecodeOpRet(const CScript &scriptPubKey,uint256 &assetid,uint256 &asseti
|
|||||||
return(funcid);
|
return(funcid);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Getorigaddr(char *destaddr,const CTransaction& tx)
|
bool Getorigaddr(char *destaddr,CTransaction& tx)
|
||||||
{
|
{
|
||||||
uint256 assetid,assetid2; uint64_t price,nValue=0; int32_t n; uint8_t funcid; std::vector<uint8_t> origpubkey; CScript script;
|
uint256 assetid,assetid2; uint64_t price,nValue=0; int32_t n; uint8_t funcid; std::vector<uint8_t> origpubkey; CScript script;
|
||||||
n = tx.vout.size();
|
n = tx.vout.size();
|
||||||
@@ -236,7 +236,7 @@ bool IsAssetInput(CScript const& scriptSig)
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t IsAssetvout(uint64_t &price,std::vector<uint8_t> &origpubkey,const CTransaction& tx,int32_t v,uint256 refassetid)
|
uint64_t IsAssetvout(uint64_t &price,std::vector<uint8_t> &origpubkey,CTransaction& tx,int32_t v,uint256 refassetid)
|
||||||
{
|
{
|
||||||
uint256 assetid,assetid2; uint64_t nValue=0; int32_t n; uint8_t funcid;
|
uint256 assetid,assetid2; uint64_t nValue=0; int32_t n; uint8_t funcid;
|
||||||
if ( tx.vout[v].scriptPubKey.IsPayToCryptoCondition() != 0 )
|
if ( tx.vout[v].scriptPubKey.IsPayToCryptoCondition() != 0 )
|
||||||
@@ -268,7 +268,7 @@ uint64_t IsAssetvout(uint64_t &price,std::vector<uint8_t> &origpubkey,const CTra
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t AssetValidatevin(Eval* eval,char *origaddr,const CTransaction &tx,const CTransaction &vinTx)
|
uint64_t AssetValidatevin(Eval* eval,char *origaddr,CTransaction &tx,CTransaction &vinTx)
|
||||||
{
|
{
|
||||||
uint256 hashBlock; char destaddr[64];
|
uint256 hashBlock; char destaddr[64];
|
||||||
origaddr[0] = destaddr[0] = 0;
|
origaddr[0] = destaddr[0] = 0;
|
||||||
@@ -285,9 +285,9 @@ uint64_t AssetValidatevin(Eval* eval,char *origaddr,const CTransaction &tx,const
|
|||||||
else return(vinTx.vout[0].nValue);
|
else return(vinTx.vout[0].nValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t AssetValidateBuyvin(Eval* eval,uint64_t &tmpprice,std::vector<uint8_t> &tmporigpubkey,char *origaddr,const CTransaction &tx)
|
uint64_t AssetValidateBuyvin(Eval* eval,uint64_t &tmpprice,std::vector<uint8_t> &tmporigpubkey,char *origaddr,CTransaction &tx)
|
||||||
{
|
{
|
||||||
const CTransaction vinTx; uint64_t nValue; uint256 assetid,assetid2;
|
CTransaction vinTx; uint64_t nValue; uint256 assetid,assetid2;
|
||||||
if ( (nValue= AssetValidatevin(eval,origaddr,tx,vinTx)) == 0 )
|
if ( (nValue= AssetValidatevin(eval,origaddr,tx,vinTx)) == 0 )
|
||||||
return(0);
|
return(0);
|
||||||
else if ( vinTx.vout[0].scriptPubKey.IsPayToCryptoCondition() != 0 )
|
else if ( vinTx.vout[0].scriptPubKey.IsPayToCryptoCondition() != 0 )
|
||||||
@@ -297,9 +297,9 @@ uint64_t AssetValidateBuyvin(Eval* eval,uint64_t &tmpprice,std::vector<uint8_t>
|
|||||||
else return(nValue);
|
else return(nValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t AssetValidateSellvin(Eval* eval,uint64_t &tmpprice,std::vector<uint8_t> &tmporigpubkey,char *origaddr,const CTransaction &tx,uint256 assetid)
|
uint64_t AssetValidateSellvin(Eval* eval,uint64_t &tmpprice,std::vector<uint8_t> &tmporigpubkey,char *origaddr,CTransaction &tx,uint256 assetid)
|
||||||
{
|
{
|
||||||
const CTransaction vinTx; uint64_t nValue,assetoshis;
|
CTransaction vinTx; uint64_t nValue,assetoshis;
|
||||||
if ( (nValue= AssetValidatevin(eval,origaddr,tx,vinTx)) == 0 )
|
if ( (nValue= AssetValidatevin(eval,origaddr,tx,vinTx)) == 0 )
|
||||||
return(0);
|
return(0);
|
||||||
if ( (assetoshis= IsAssetvout(tmpprice,tmporigpubkey,vinTx,0,assetid)) != 0 )
|
if ( (assetoshis= IsAssetvout(tmpprice,tmporigpubkey,vinTx,0,assetid)) != 0 )
|
||||||
@@ -326,10 +326,10 @@ bool ValidateRemainder(uint64_t remaining_price,uint64_t remaining_nValue,uint64
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AssetValidate(Eval* eval,const CTransaction &tx,int32_t numvouts,uint8_t funcid,uint256 assetid,uint256 assetid2,uint64_t remaining_price,std::vector<uint8_t> origpubkey)
|
bool AssetValidate(Eval* eval,CTransaction &tx,int32_t numvouts,uint8_t funcid,uint256 assetid,uint256 assetid2,uint64_t remaining_price,std::vector<uint8_t> origpubkey)
|
||||||
{
|
{
|
||||||
static uint256 zero;
|
static uint256 zero;
|
||||||
CTxDestination address; const CTransaction vinTx; uint256 hashBlock; int32_t i,numvins; uint64_t nValue,assetoshis,outputs,inputs,tmpprice,ignore; std::vector<uint8_t> tmporigpubkey,ignorepubkey; char destaddr[64],origaddr[64];
|
CTxDestination address; CTransaction vinTx; uint256 hashBlock; int32_t i,numvins; uint64_t nValue,assetoshis,outputs,inputs,tmpprice,ignore; std::vector<uint8_t> tmporigpubkey,ignorepubkey; char destaddr[64],origaddr[64];
|
||||||
numvins = tx.vin.size();
|
numvins = tx.vin.size();
|
||||||
outputs = inputs = 0;
|
outputs = inputs = 0;
|
||||||
if ( IsAssetInput(tx.vin[0].scriptSig) != 0 )
|
if ( IsAssetInput(tx.vin[0].scriptSig) != 0 )
|
||||||
@@ -535,10 +535,10 @@ bool AssetValidate(Eval* eval,const CTransaction &tx,int32_t numvouts,uint8_t fu
|
|||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ProcessAssets(Eval* eval, std::vector<uint8_t> paramsNull, const CTransaction &tx, unsigned int nIn)
|
bool ProcessAssets(Eval* eval, std::vector<uint8_t> paramsNull, CTransaction &tx, unsigned int nIn)
|
||||||
{
|
{
|
||||||
static uint256 zero;
|
static uint256 zero;
|
||||||
const CTransaction createTx; uint256 assetid,assetid2,hashBlock; uint8_t funcid; int32_t i,n; uint64_t amount; std::vector<uint8_t> origpubkey;
|
CTransaction createTx; uint256 assetid,assetid2,hashBlock; uint8_t funcid; int32_t i,n; uint64_t amount; std::vector<uint8_t> origpubkey;
|
||||||
if ( paramsNull.size() != 0 ) // Don't expect params
|
if ( paramsNull.size() != 0 ) // Don't expect params
|
||||||
return eval->Invalid("Cannot have params");
|
return eval->Invalid("Cannot have params");
|
||||||
if ( (n= tx.vout.size()) == 0 )
|
if ( (n= tx.vout.size()) == 0 )
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ bool Eval::GetSpendsConfirmed(uint256 hash, std::vector<CTransaction> &spends) c
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Eval::GetTxUnconfirmed(const uint256 &hash, const CTransaction &txOut, uint256 &hashBlock) const
|
bool Eval::GetTxUnconfirmed(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock) const
|
||||||
{
|
{
|
||||||
bool fAllowSlow = false; // Don't allow slow
|
bool fAllowSlow = false; // Don't allow slow
|
||||||
return GetTransaction(hash, txOut, hashBlock, fAllowSlow);
|
return GetTransaction(hash, txOut, hashBlock, fAllowSlow);
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public:
|
|||||||
/*
|
/*
|
||||||
* IO functions
|
* IO functions
|
||||||
*/
|
*/
|
||||||
virtual bool GetTxUnconfirmed(const uint256 &hash, const CTransaction &txOut, uint256 &hashBlock) const;
|
virtual bool GetTxUnconfirmed(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock) const;
|
||||||
virtual bool GetTxConfirmed(const uint256 &hash, CTransaction &txOut, CBlockIndex &block) const;
|
virtual bool GetTxConfirmed(const uint256 &hash, CTransaction &txOut, CBlockIndex &block) const;
|
||||||
virtual unsigned int GetCurrentHeight() const;
|
virtual unsigned int GetCurrentHeight() const;
|
||||||
virtual bool GetSpendsConfirmed(uint256 hash, std::vector<CTransaction> &spends) const;
|
virtual bool GetSpendsConfirmed(uint256 hash, std::vector<CTransaction> &spends) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user