@@ -623,7 +623,7 @@ bool komodo_txnotarizedconfirmed(uint256 txid)
|
|||||||
fprintf(stderr,"komodo_txnotarizedconfirmed no hashBlock for txid %s\n",txid.ToString().c_str());
|
fprintf(stderr,"komodo_txnotarizedconfirmed no hashBlock for txid %s\n",txid.ToString().c_str());
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
else if ( (pindex= mapBlockIndex[hashBlock]) == 0 || (txheight= pindex->GetHeight()) <= 0 )
|
else if ( (pindex= komodo_blockindex(hashBlock)) == 0 || (txheight= pindex->GetHeight()) <= 0 )
|
||||||
{
|
{
|
||||||
fprintf(stderr,"komodo_txnotarizedconfirmed no txheight.%d %p for txid %s\n",txheight,pindex,txid.ToString().c_str());
|
fprintf(stderr,"komodo_txnotarizedconfirmed no txheight.%d %p for txid %s\n",txheight,pindex,txid.ToString().c_str());
|
||||||
return(0);
|
return(0);
|
||||||
|
|||||||
@@ -314,10 +314,10 @@ bool PaymentsValidate(struct CCcontract_info *cp,Eval* eval,const CTransaction &
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check the chain depth vs locked blocks requirement.
|
// check the chain depth vs locked blocks requirement.
|
||||||
CBlockIndex* pblockindex = mapBlockIndex[blockhash];
|
CBlockIndex* pblockindex = komodo_blockindex(blockhash);
|
||||||
if ( pblockindex->GetHeight() > ht-lockedblocks )
|
if ( pblockindex == 0 || pblockindex->GetHeight() > ht-lockedblocks )
|
||||||
{
|
{
|
||||||
fprintf(stderr, "vin.%i is not elegible to be spent yet height.%i vs elegible_ht.%i\n", i, pblockindex->GetHeight(), ht-lockedblocks);
|
fprintf(stderr, "vin.%i is not elegible to be spent yet height.%i vs elegible_ht.%i\n", i, pblockindex!=0?pblockindex->GetHeight():0, ht-lockedblocks);
|
||||||
return(eval->Invalid("vin not elegible"));
|
return(eval->Invalid("vin not elegible"));
|
||||||
}
|
}
|
||||||
} else return(eval->Invalid("cant get vin transaction"));
|
} else return(eval->Invalid("cant get vin transaction"));
|
||||||
|
|||||||
@@ -6413,8 +6413,8 @@ bool LoadExternalBlockFile(FILE* fileIn, CDiskBlockPos *dbp)
|
|||||||
nLoaded++;
|
nLoaded++;
|
||||||
if (state.IsError())
|
if (state.IsError())
|
||||||
break;
|
break;
|
||||||
} else if (hash != chainparams.GetConsensus().hashGenesisBlock && mapBlockIndex[hash]->GetHeight() % 1000 == 0) {
|
} else if (hash != chainparams.GetConsensus().hashGenesisBlock && komodo_blockheight(hash) % 1000 == 0) {
|
||||||
LogPrintf("Block Import: already had block %s at height %d\n", hash.ToString(), mapBlockIndex[hash]->GetHeight());
|
LogPrintf("Block Import: already had block %s at height %d\n", hash.ToString(), komodo_blockheight(hash));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recursively process earlier encountered successors of this block
|
// Recursively process earlier encountered successors of this block
|
||||||
|
|||||||
@@ -46,6 +46,7 @@
|
|||||||
#include <thread>
|
#include <thread>
|
||||||
|
|
||||||
#include "paymentdisclosuredb.h"
|
#include "paymentdisclosuredb.h"
|
||||||
|
int32_t komodo_blockheight(uint256 hash);
|
||||||
|
|
||||||
using namespace libzcash;
|
using namespace libzcash;
|
||||||
|
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ using namespace libzcash;
|
|||||||
extern char ASSETCHAINS_SYMBOL[65];
|
extern char ASSETCHAINS_SYMBOL[65];
|
||||||
|
|
||||||
int32_t komodo_dpowconfs(int32_t height,int32_t numconfs);
|
int32_t komodo_dpowconfs(int32_t height,int32_t numconfs);
|
||||||
|
int32_t komodo_blockheight(uint256 hash);
|
||||||
int tx_height( const uint256 &hash );
|
int tx_height( const uint256 &hash );
|
||||||
extern UniValue signrawtransaction(const UniValue& params, bool fHelp);
|
extern UniValue signrawtransaction(const UniValue& params, bool fHelp);
|
||||||
extern UniValue sendrawtransaction(const UniValue& params, bool fHelp);
|
extern UniValue sendrawtransaction(const UniValue& params, bool fHelp);
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ void WalletTxToJSON(const CWalletTx& wtx, UniValue& entry)
|
|||||||
entry.push_back(Pair("confirmations", komodo_dpowconfs((int32_t)komodo_blockheight(wtx.hashBlock),confirms)));
|
entry.push_back(Pair("confirmations", komodo_dpowconfs((int32_t)komodo_blockheight(wtx.hashBlock),confirms)));
|
||||||
entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex()));
|
entry.push_back(Pair("blockhash", wtx.hashBlock.GetHex()));
|
||||||
entry.push_back(Pair("blockindex", wtx.nIndex));
|
entry.push_back(Pair("blockindex", wtx.nIndex));
|
||||||
entry.push_back(Pair("blocktime", komodo_blocktime(wtx.hashBlock)));
|
entry.push_back(Pair("blocktime", (uint64_t)komodo_blocktime(wtx.hashBlock)));
|
||||||
entry.push_back(Pair("expiryheight", (int64_t)wtx.nExpiryHeight));
|
entry.push_back(Pair("expiryheight", (int64_t)wtx.nExpiryHeight));
|
||||||
} else entry.push_back(Pair("confirmations", confirms));
|
} else entry.push_back(Pair("confirmations", confirms));
|
||||||
uint256 hash = wtx.GetHash();
|
uint256 hash = wtx.GetHash();
|
||||||
|
|||||||
Reference in New Issue
Block a user