nSPV modifications for CC and other fixes (#29)
This commit is contained in:
committed by
GitHub
parent
13b1075e3a
commit
bc665882ed
24
src/main.cpp
24
src/main.cpp
@@ -2229,14 +2229,14 @@ bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlo
|
||||
memset(&hashBlock,0,sizeof(hashBlock));
|
||||
if ( KOMODO_NSPV != 0 )
|
||||
{
|
||||
int64_t rewardsum = 0; int32_t i,retval,txheight = 0,vout = 0;
|
||||
int64_t rewardsum = 0; int32_t i,retval,txheight,currentheight,height=0,vout = 0;
|
||||
for (i=0; i<NSPV_U.U.numutxos; i++)
|
||||
if ( NSPV_U.U.utxos[i].txid == hash )
|
||||
{
|
||||
txheight = NSPV_U.U.utxos[i].height;
|
||||
height = NSPV_U.U.utxos[i].height;
|
||||
break;
|
||||
}
|
||||
retval = NSPV_gettransaction(1,vout,hash,txheight,txOut,0,0,rewardsum);
|
||||
retval = NSPV_gettransaction(1,vout,hash,height,txOut,hashBlock,txheight,currentheight,0,0,rewardsum);
|
||||
return(retval != -1);
|
||||
}
|
||||
// need a GetTransaction without lock so the validation code for assets can run without deadlock
|
||||
@@ -2278,6 +2278,24 @@ bool myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlo
|
||||
return false;
|
||||
}
|
||||
|
||||
bool NSPV_myGetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, int32_t &txheight, int32_t ¤theight)
|
||||
{
|
||||
memset(&hashBlock,0,sizeof(hashBlock));
|
||||
if ( KOMODO_NSPV != 0 )
|
||||
{
|
||||
int64_t rewardsum = 0; int32_t i,retval,height=0,vout = 0;
|
||||
for (i=0; i<NSPV_U.U.numutxos; i++)
|
||||
if ( NSPV_U.U.utxos[i].txid == hash )
|
||||
{
|
||||
height = NSPV_U.U.utxos[i].height;
|
||||
break;
|
||||
}
|
||||
retval = NSPV_gettransaction(1,vout,hash,height,txOut,hashBlock,txheight,currentheight,0,0,rewardsum);
|
||||
return(retval != -1);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Return transaction in tx, and if it was found inside a block, its hash is placed in hashBlock */
|
||||
bool GetTransaction(const uint256 &hash, CTransaction &txOut, uint256 &hashBlock, bool fAllowSlow)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user