Merge upstream FSM into duke
This commit is contained in:
@@ -973,6 +973,13 @@ UniValue z_exportviewingkey(const UniValue& params, bool fHelp)
|
||||
}
|
||||
|
||||
extern int32_t KOMODO_NSPV;
|
||||
#ifndef KOMODO_NSPV_FULLNODE
|
||||
#define KOMODO_NSPV_FULLNODE (KOMODO_NSPV <= 0)
|
||||
#endif // !KOMODO_NSPV_FULLNODE
|
||||
#ifndef KOMODO_NSPV_SUPERLITE
|
||||
#define KOMODO_NSPV_SUPERLITE (KOMODO_NSPV > 0)
|
||||
#endif // !KOMODO_NSPV_SUPERLITE
|
||||
uint256 zeroid;
|
||||
UniValue NSPV_getinfo_req(int32_t reqht);
|
||||
UniValue NSPV_login(char *wifstr);
|
||||
UniValue NSPV_logout();
|
||||
@@ -993,7 +1000,7 @@ UniValue nspv_getinfo(const UniValue& params, bool fHelp)
|
||||
int32_t reqht = 0;
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("nspv_getinfo [hdrheight]\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
if ( params.size() == 1 )
|
||||
reqht = atoi((char *)params[0].get_str().c_str());
|
||||
@@ -1004,7 +1011,7 @@ UniValue nspv_logout(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if ( fHelp || params.size() != 0 )
|
||||
throw runtime_error("nspv_logout\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
return(NSPV_logout());
|
||||
}
|
||||
@@ -1013,7 +1020,7 @@ UniValue nspv_login(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if ( fHelp || params.size() != 1 )
|
||||
throw runtime_error("nspv_login wif\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
return(NSPV_login((char *)params[0].get_str().c_str()));
|
||||
}
|
||||
@@ -1023,7 +1030,7 @@ UniValue nspv_listunspent(const UniValue& params, bool fHelp)
|
||||
int32_t skipcount = 0,CCflag = 0;
|
||||
if ( fHelp || params.size() > 3 )
|
||||
throw runtime_error("nspv_listunspent [address [isCC [skipcount]]]\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
if ( params.size() == 0 )
|
||||
{
|
||||
@@ -1048,7 +1055,7 @@ UniValue nspv_mempool(const UniValue& params, bool fHelp)
|
||||
memset(&txid,0,sizeof(txid));
|
||||
if ( fHelp || params.size() > 5 )
|
||||
throw runtime_error("nspv_mempool func(0 all, 1 address recv, 2 txid/vout spent, 3 txid inmempool) address isCC [txid vout]]]\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
funcid = atoi((char *)params[0].get_str().c_str());
|
||||
coinaddr = (char *)params[1].get_str().c_str();
|
||||
@@ -1068,7 +1075,7 @@ UniValue nspv_listtransactions(const UniValue& params, bool fHelp)
|
||||
int32_t skipcount = 0,CCflag = 0;
|
||||
if ( fHelp || params.size() > 3 )
|
||||
throw runtime_error("nspv_listtransactions [address [isCC [skipcount]]]\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
if ( params.size() == 0 )
|
||||
{
|
||||
@@ -1093,7 +1100,7 @@ UniValue nspv_spentinfo(const UniValue& params, bool fHelp)
|
||||
uint256 txid; int32_t vout;
|
||||
if ( fHelp || params.size() != 2 )
|
||||
throw runtime_error("nspv_spentinfo txid vout\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
txid = Parseuint256((char *)params[0].get_str().c_str());
|
||||
vout = atoi((char *)params[1].get_str().c_str());
|
||||
@@ -1105,7 +1112,7 @@ UniValue nspv_notarizations(const UniValue& params, bool fHelp)
|
||||
int32_t height;
|
||||
if ( fHelp || params.size() != 1 )
|
||||
throw runtime_error("nspv_notarizations height\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
height = atoi((char *)params[0].get_str().c_str());
|
||||
return(NSPV_notarizations(height));
|
||||
@@ -1116,7 +1123,7 @@ UniValue nspv_hdrsproof(const UniValue& params, bool fHelp)
|
||||
int32_t prevheight,nextheight;
|
||||
if ( fHelp || params.size() != 2 )
|
||||
throw runtime_error("nspv_hdrsproof prevheight nextheight\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
prevheight = atoi((char *)params[0].get_str().c_str());
|
||||
nextheight = atoi((char *)params[1].get_str().c_str());
|
||||
@@ -1128,7 +1135,7 @@ UniValue nspv_txproof(const UniValue& params, bool fHelp)
|
||||
uint256 txid; int32_t height;
|
||||
if ( fHelp || params.size() != 2 )
|
||||
throw runtime_error("nspv_txproof txid height\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
txid = Parseuint256((char *)params[0].get_str().c_str());
|
||||
height = atoi((char *)params[1].get_str().c_str());
|
||||
@@ -1140,7 +1147,7 @@ UniValue nspv_spend(const UniValue& params, bool fHelp)
|
||||
uint64_t satoshis;
|
||||
if ( fHelp || params.size() != 2 )
|
||||
throw runtime_error("nspv_spend address amount\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
if ( NSPV_address.size() == 0 )
|
||||
throw runtime_error("to nspv_send you need an active nspv_login\n");
|
||||
@@ -1155,7 +1162,7 @@ UniValue nspv_broadcast(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if ( fHelp || params.size() != 1 )
|
||||
throw runtime_error("nspv_broadcast hex\n");
|
||||
if ( KOMODO_NSPV <= 0 )
|
||||
if ( KOMODO_NSPV_FULLNODE )
|
||||
throw runtime_error("-nSPV=1 must be set to use nspv\n");
|
||||
return(NSPV_broadcast((char *)params[0].get_str().c_str()));
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ void OS_randombytes(unsigned char *x,long xlen);
|
||||
|
||||
UniValue getnewaddress(const UniValue& params, bool fHelp)
|
||||
{
|
||||
if ( KOMODO_NSPV <= 0 && !EnsureWalletIsAvailable(fHelp) )
|
||||
if ( KOMODO_NSPV_FULLNODE && !EnsureWalletIsAvailable(fHelp) )
|
||||
return NullUniValue;
|
||||
|
||||
if (fHelp || params.size() > 1)
|
||||
@@ -179,7 +179,7 @@ UniValue getnewaddress(const UniValue& params, bool fHelp)
|
||||
+ HelpExampleRpc("getnewaddress", "")
|
||||
);
|
||||
|
||||
if ( KOMODO_NSPV > 0 )
|
||||
if ( KOMODO_NSPV_SUPERLITE )
|
||||
{
|
||||
UniValue result(UniValue::VOBJ); uint8_t priv32[32];
|
||||
#ifndef __WIN32
|
||||
@@ -2975,7 +2975,7 @@ UniValue listunspent(const UniValue& params, bool fHelp)
|
||||
uint64_t komodo_interestsum()
|
||||
{
|
||||
#ifdef ENABLE_WALLET
|
||||
if ( ASSETCHAINS_SYMBOL[0] == 0 && GetBoolArg("-disablewallet", false) == 0 && KOMODO_NSPV <= 0 )
|
||||
if ( ASSETCHAINS_SYMBOL[0] == 0 && GetBoolArg("-disablewallet", false) == 0 && KOMODO_NSPV_FULLNODE )
|
||||
{
|
||||
uint64_t interest,sum = 0; int32_t txheight; uint32_t locktime;
|
||||
vector<COutput> vecOutputs;
|
||||
@@ -5673,7 +5673,7 @@ UniValue channelsaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_CHANNELS);
|
||||
if ( fHelp || params.size() != 1 )
|
||||
throw runtime_error("channelsaddress pubkey\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
return(CCaddress(cp,(char *)"Channels",pubkey));
|
||||
@@ -5684,8 +5684,6 @@ UniValue cclibaddress(const UniValue& params, bool fHelp)
|
||||
struct CCcontract_info *cp,C; std::vector<unsigned char> pubkey; uint8_t evalcode = EVAL_FIRSTUSER;
|
||||
if ( fHelp || params.size() > 2 )
|
||||
throw runtime_error("cclibaddress [evalcode] [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() >= 1 )
|
||||
{
|
||||
evalcode = atoi(params[0].get_str().c_str());
|
||||
@@ -5695,6 +5693,8 @@ UniValue cclibaddress(const UniValue& params, bool fHelp)
|
||||
pubkey = ParseHex(params[1].get_str().c_str());
|
||||
}
|
||||
cp = CCinit(&C,evalcode);
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( cp == 0 )
|
||||
throw runtime_error("error creating *cp\n");
|
||||
return(CCaddress(cp,(char *)"CClib",pubkey));
|
||||
@@ -5871,7 +5871,7 @@ UniValue oraclesaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_ORACLES);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("oraclesaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -5885,7 +5885,7 @@ UniValue pricesaddress(const UniValue& params, bool fHelp)
|
||||
assetscp = CCinit(&C2,EVAL_PRICES);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("pricesaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -5907,7 +5907,7 @@ UniValue pegsaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_PEGS);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("pegssaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -5920,7 +5920,7 @@ UniValue marmaraaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_MARMARA);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("Marmaraaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -5933,7 +5933,7 @@ UniValue paymentsaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_PAYMENTS);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("paymentsaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -5946,7 +5946,7 @@ UniValue gatewaysaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_GATEWAYS);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("gatewaysaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -5959,7 +5959,7 @@ UniValue heiraddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_HEIR);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("heiraddress pubkey\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
return(CCaddress(cp,(char *)"Heir",pubkey));
|
||||
@@ -5971,7 +5971,7 @@ UniValue lottoaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_LOTTO);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("lottoaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -5984,7 +5984,7 @@ UniValue FSMaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_FSM);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("FSMaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -5997,7 +5997,7 @@ UniValue auctionaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_AUCTION);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("auctionaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -6010,7 +6010,7 @@ UniValue diceaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_DICE);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("diceaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -6024,7 +6024,7 @@ UniValue faucetaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_FAUCET);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("faucetaddress [pubkey]\n");
|
||||
error = ensure_CCrequirements(0);
|
||||
error = ensure_CCrequirements(cp->evalcode);
|
||||
if ( error < 0 )
|
||||
throw runtime_error(strprintf("to use CC contracts, you need to launch daemon with valid -pubkey= for an address in your wallet. ERR=%d\n", error));
|
||||
if ( params.size() == 1 )
|
||||
@@ -6038,7 +6038,7 @@ UniValue rewardsaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_REWARDS);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("rewardsaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -6051,7 +6051,7 @@ UniValue assetsaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C, EVAL_ASSETS);
|
||||
if (fHelp || params.size() > 1)
|
||||
throw runtime_error("assetsaddress [pubkey]\n");
|
||||
if (ensure_CCrequirements(0) < 0)
|
||||
if (ensure_CCrequirements(cp->evalcode) < 0)
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if (params.size() == 1)
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -6064,7 +6064,7 @@ UniValue tokenaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_TOKENS);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("tokenaddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -6077,7 +6077,7 @@ UniValue importgatewayaddress(const UniValue& params, bool fHelp)
|
||||
cp = CCinit(&C,EVAL_IMPORTGATEWAY);
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("importgatewayddress [pubkey]\n");
|
||||
if ( ensure_CCrequirements(0) < 0 )
|
||||
if ( ensure_CCrequirements(cp->evalcode) < 0 )
|
||||
throw runtime_error(CC_REQUIREMENTS_MSG);
|
||||
if ( params.size() == 1 )
|
||||
pubkey = ParseHex(params[0].get_str().c_str());
|
||||
@@ -7131,7 +7131,7 @@ UniValue faucetfund(const UniValue& params, bool fHelp)
|
||||
if ( fHelp || params.size() > 1 )
|
||||
throw runtime_error("faucetfund amount\n");
|
||||
funds = atof(params[0].get_str().c_str()) * COIN + 0.00000000499999;
|
||||
if ( (0) && KOMODO_NSPV > 0 )
|
||||
if ( (0) && KOMODO_NSPV_SUPERLITE )
|
||||
{
|
||||
char coinaddr[64]; struct CCcontract_info *cp,C; CTxOut v;
|
||||
cp = CCinit(&C,EVAL_FAUCET);
|
||||
|
||||
@@ -1841,7 +1841,7 @@ bool CWallet::AddToWalletIfInvolvingMe(const CTransaction& tx, const CBlock* pbl
|
||||
|
||||
void CWallet::SyncTransaction(const CTransaction& tx, const CBlock* pblock)
|
||||
{
|
||||
LOCK2(cs_main, cs_wallet);
|
||||
LOCK(cs_wallet);
|
||||
if (!AddToWalletIfInvolvingMe(tx, pblock, true))
|
||||
return; // Not one of ours
|
||||
|
||||
@@ -4892,9 +4892,8 @@ CWalletKey::CWalletKey(int64_t nExpires)
|
||||
nTimeExpires = nExpires;
|
||||
}
|
||||
|
||||
int CMerkleTx::SetMerkleBranch(const CBlock& block)
|
||||
void CMerkleTx::SetMerkleBranch(const CBlock& block)
|
||||
{
|
||||
AssertLockHeld(cs_main);
|
||||
CBlock blockTmp;
|
||||
|
||||
// Update the tx's hashBlock
|
||||
@@ -4909,21 +4908,10 @@ int CMerkleTx::SetMerkleBranch(const CBlock& block)
|
||||
vMerkleBranch.clear();
|
||||
nIndex = -1;
|
||||
LogPrintf("ERROR: SetMerkleBranch(): couldn't find tx in block\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Fill in merkle branch
|
||||
vMerkleBranch = block.GetMerkleBranch(nIndex);
|
||||
|
||||
// Is the tx in a block that's in the main chain
|
||||
BlockMap::iterator mi = mapBlockIndex.find(hashBlock);
|
||||
if (mi == mapBlockIndex.end())
|
||||
return 0;
|
||||
const CBlockIndex* pindex = (*mi).second;
|
||||
if (!pindex || !chainActive.Contains(pindex))
|
||||
return 0;
|
||||
|
||||
return chainActive.Height() - pindex->GetHeight() + 1;
|
||||
}
|
||||
|
||||
int CMerkleTx::GetDepthInMainChainINTERNAL(const CBlockIndex* &pindexRet) const
|
||||
|
||||
@@ -386,7 +386,7 @@ public:
|
||||
READWRITE(nIndex);
|
||||
}
|
||||
|
||||
int SetMerkleBranch(const CBlock& block);
|
||||
void SetMerkleBranch(const CBlock& block);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user