Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Go to the source code of this file.
Functions | |
double | GetDifficulty (const CBlockIndex *blockindex=nullptr) |
Get the difficulty of the net wrt to the given block index, or the chain tip if not provided. More... | |
void | RPCNotifyBlockChange (bool ibd, const CBlockIndex *) |
Callback for when block tip changed. More... | |
UniValue | blockToJSON (const CBlock &block, const CBlockIndex *blockindex, bool txDetails=false) |
Block description to JSON. More... | |
UniValue | mempoolInfoToJSON () |
Mempool information to JSON. More... | |
UniValue | mempoolToJSON (bool fVerbose=false) |
Mempool to JSON. More... | |
UniValue | blockheaderToJSON (const CBlockIndex *blockindex) |
Block header to JSON. More... | |
Function Documentation
◆ blockheaderToJSON()
UniValue blockheaderToJSON | ( | const CBlockIndex * | blockindex | ) |
Block header to JSON.
Definition at line 97 of file blockchain.cpp.
References AssertLockHeld(), chainActive, llmq::chainLocksHandler, CChain::Contains(), cs_main, CBlockIndex::GetBlockHash(), GetDifficulty(), base_blob< BITS >::GetHex(), base_uint< BITS >::GetHex(), CBlockIndex::GetMedianTimePast(), CBlockIndex::hashMerkleRoot, CChain::Height(), CBlockIndex::nBits, CBlockIndex::nChainWork, CChain::Next(), CBlockIndex::nHeight, CBlockIndex::nNonce, CBlockIndex::nTime, CBlockIndex::nTx, CBlockIndex::nVersion, Pair(), CBlockIndex::pprev, UniValue::push_back(), strprintf, and UniValue::VOBJ.
Referenced by getblockheader(), getblockheaders(), and rest_headers().
◆ blockToJSON()
UniValue blockToJSON | ( | const CBlock & | block, |
const CBlockIndex * | blockindex, | ||
bool | txDetails = false |
||
) |
Block description to JSON.
Definition at line 130 of file blockchain.cpp.
References AssertLockHeld(), chainActive, llmq::chainLocksHandler, CChain::Contains(), cs_main, CBlockIndex::GetBlockHash(), CBlockHeader::GetBlockTime(), GetDifficulty(), base_blob< BITS >::GetHex(), base_uint< BITS >::GetHex(), CBlockIndex::GetMedianTimePast(), GetSerializeSize(), GetTxPayload(), llmq::CChainLocksHandler::HasChainLock(), CBlockHeader::hashMerkleRoot, CChain::Height(), llmq::CInstantSendManager::IsLocked(), CBlockHeader::nBits, CBlockIndex::nChainWork, CChain::Next(), CBlockIndex::nHeight, CBlockHeader::nNonce, CBlockIndex::nTx, CBlockHeader::nVersion, Pair(), CBlockIndex::pprev, PROTOCOL_VERSION, UniValue::push_back(), llmq::quorumInstantSendManager, SER_NETWORK, strprintf, CCbTx::ToJson(), TxToUniv(), UniValue::VARR, UniValue::VOBJ, and CBlock::vtx.
Referenced by getblock(), and rest_block().
◆ GetDifficulty()
double GetDifficulty | ( | const CBlockIndex * | blockindex = nullptr | ) |
Get the difficulty of the net wrt to the given block index, or the chain tip if not provided.
- Returns
- A floating point number that is a multiple of the main net minimum difficulty (4295032833 hashes).
Definition at line 92 of file blockchain.cpp.
References chainActive, and GetDifficulty().
◆ mempoolInfoToJSON()
UniValue mempoolInfoToJSON | ( | ) |
Mempool information to JSON.
Definition at line 1650 of file blockchain.cpp.
References DEFAULT_MAX_MEMPOOL_SIZE, CTxMemPool::DynamicMemoryUsage(), gArgs, ArgsManager::GetArg(), CFeeRate::GetFeePerK(), CTxMemPool::GetMinFee(), CTxMemPool::GetTotalTxSize(), mempool, minRelayTxFee, Pair(), UniValue::push_back(), llmq::quorumInstantSendManager, CTxMemPool::size(), ValueFromAmount(), and UniValue::VOBJ.
Referenced by getmempoolinfo(), and rest_mempool_info().
◆ mempoolToJSON()
Mempool to JSON.
Definition at line 453 of file blockchain.cpp.
References CTxMemPool::cs, entryToJSON(), CTransaction::GetHash(), CTxMemPoolEntry::GetTx(), LOCK, CTxMemPool::mapTx, mempool, Pair(), UniValue::push_back(), CTxMemPool::queryHashes(), base_blob< BITS >::ToString(), UniValue::VARR, and UniValue::VOBJ.
Referenced by getrawmempool(), and rest_mempool_contents().
◆ RPCNotifyBlockChange()
void RPCNotifyBlockChange | ( | bool | ibd, |
const CBlockIndex * | |||
) |
Callback for when block tip changed.
Definition at line 252 of file blockchain.cpp.
References cond_blockchange, cs_blockchange, CBlockIndex::GetBlockHash(), CUpdatedBlock::hash, CUpdatedBlock::height, latestblock, and CBlockIndex::nHeight.
Referenced by AppInitMain(), OnRPCStarted(), and OnRPCStopped().