Dash Core  0.12.2.1
P2P Digital Currency
blockchain.cpp File Reference
#include "amount.h"
#include "chain.h"
#include "chainparams.h"
#include "checkpoints.h"
#include "coins.h"
#include "consensus/validation.h"
#include "validation.h"
#include "policy/policy.h"
#include "primitives/transaction.h"
#include "rpc/server.h"
#include "streams.h"
#include "sync.h"
#include "txmempool.h"
#include "util.h"
#include "utilstrencodings.h"
#include <stdint.h>
#include <univalue.h>

Go to the source code of this file.

Classes

struct  CompareBlocksByHeight
 

Functions

void TxToJSON (const CTransaction &tx, const uint256 hashBlock, UniValue &entry)
 
void ScriptPubKeyToJSON (const CScript &scriptPubKey, UniValue &out, bool fIncludeHex)
 
double GetDifficulty (const CBlockIndex *blockindex)
 
UniValue blockheaderToJSON (const CBlockIndex *blockindex)
 
UniValue blockToJSON (const CBlock &block, const CBlockIndex *blockindex, bool txDetails=false)
 
UniValue getblockcount (const UniValue &params, bool fHelp)
 
UniValue getbestblockhash (const UniValue &params, bool fHelp)
 
UniValue getdifficulty (const UniValue &params, bool fHelp)
 
UniValue mempoolToJSON (bool fVerbose=false)
 
UniValue getrawmempool (const UniValue &params, bool fHelp)
 
UniValue getblockhashes (const UniValue &params, bool fHelp)
 
UniValue getblockhash (const UniValue &params, bool fHelp)
 
UniValue getblockheader (const UniValue &params, bool fHelp)
 
UniValue getblockheaders (const UniValue &params, bool fHelp)
 
UniValue getblock (const UniValue &params, bool fHelp)
 
UniValue gettxoutsetinfo (const UniValue &params, bool fHelp)
 
UniValue gettxout (const UniValue &params, bool fHelp)
 
UniValue verifychain (const UniValue &params, bool fHelp)
 
static UniValue SoftForkMajorityDesc (int minVersion, CBlockIndex *pindex, int nRequired, const Consensus::Params &consensusParams)
 
static UniValue SoftForkDesc (const std::string &name, int version, CBlockIndex *pindex, const Consensus::Params &consensusParams)
 
static UniValue BIP9SoftForkDesc (const std::string &name, const Consensus::Params &consensusParams, Consensus::DeploymentPos id)
 
UniValue getblockchaininfo (const UniValue &params, bool fHelp)
 
UniValue getchaintips (const UniValue &params, bool fHelp)
 
UniValue mempoolInfoToJSON ()
 
UniValue getmempoolinfo (const UniValue &params, bool fHelp)
 
UniValue invalidateblock (const UniValue &params, bool fHelp)
 
UniValue reconsiderblock (const UniValue &params, bool fHelp)
 

Function Documentation

◆ BIP9SoftForkDesc()

static UniValue BIP9SoftForkDesc ( const std::string &  name,
const Consensus::Params consensusParams,
Consensus::DeploymentPos  id 
)
static

Definition at line 729 of file blockchain.cpp.

Referenced by getblockchaininfo().

◆ blockheaderToJSON()

UniValue blockheaderToJSON ( const CBlockIndex blockindex)

Definition at line 63 of file blockchain.cpp.

Referenced by getblockheader(), getblockheaders(), and rest_headers().

◆ blockToJSON()

UniValue blockToJSON ( const CBlock block,
const CBlockIndex blockindex,
bool  txDetails = false 
)

Definition at line 90 of file blockchain.cpp.

Referenced by getblock(), and rest_block().

◆ getbestblockhash()

◆ getblock()

◆ getblockchaininfo()

UniValue getblockchaininfo ( const UniValue params,
bool  fHelp 
)

◆ getblockcount()

◆ getblockhash()

◆ getblockhashes()

UniValue getblockhashes ( const UniValue params,
bool  fHelp 
)

Definition at line 277 of file blockchain.cpp.

Referenced by timestampindex.TimestampIndexTest::run_test().

◆ getblockheader()

UniValue getblockheader ( const UniValue params,
bool  fHelp 
)

◆ getblockheaders()

UniValue getblockheaders ( const UniValue params,
bool  fHelp 
)

Definition at line 394 of file blockchain.cpp.

◆ getchaintips()

UniValue getchaintips ( const UniValue params,
bool  fHelp 
)

Definition at line 837 of file blockchain.cpp.

◆ GetDifficulty()

double GetDifficulty ( const CBlockIndex blockindex)

◆ getdifficulty()

UniValue getdifficulty ( const UniValue params,
bool  fHelp 
)

Definition at line 165 of file blockchain.cpp.

◆ getmempoolinfo()

UniValue getmempoolinfo ( const UniValue params,
bool  fHelp 
)

◆ getrawmempool()

◆ gettxout()

UniValue gettxout ( const UniValue params,
bool  fHelp 
)

Definition at line 591 of file blockchain.cpp.

◆ gettxoutsetinfo()

UniValue gettxoutsetinfo ( const UniValue params,
bool  fHelp 
)

Definition at line 553 of file blockchain.cpp.

◆ invalidateblock()

UniValue invalidateblock ( const UniValue params,
bool  fHelp 
)

Definition at line 983 of file blockchain.cpp.

◆ mempoolInfoToJSON()

UniValue mempoolInfoToJSON ( )

Definition at line 948 of file blockchain.cpp.

Referenced by getmempoolinfo(), and rest_mempool_info().

◆ mempoolToJSON()

UniValue mempoolToJSON ( bool  fVerbose = false)

Definition at line 182 of file blockchain.cpp.

Referenced by getrawmempool(), and rest_mempool_contents().

◆ reconsiderblock()

UniValue reconsiderblock ( const UniValue params,
bool  fHelp 
)

Definition at line 1021 of file blockchain.cpp.

Referenced by mempool_packages.MempoolPackagesTest::run_test().

◆ ScriptPubKeyToJSON()

void ScriptPubKeyToJSON ( const CScript scriptPubKey,
UniValue out,
bool  fIncludeHex 
)

Definition at line 40 of file rawtransaction.cpp.

Referenced by decodescript(), gettxout(), and TxToJSON().

◆ SoftForkDesc()

static UniValue SoftForkDesc ( const std::string &  name,
int  version,
CBlockIndex pindex,
const Consensus::Params consensusParams 
)
static

Definition at line 719 of file blockchain.cpp.

Referenced by getblockchaininfo().

◆ SoftForkMajorityDesc()

static UniValue SoftForkMajorityDesc ( int  minVersion,
CBlockIndex pindex,
int  nRequired,
const Consensus::Params consensusParams 
)
static

Implementation of IsSuperMajority with better feedback

Definition at line 700 of file blockchain.cpp.

Referenced by SoftForkDesc().

◆ TxToJSON()

void TxToJSON ( const CTransaction tx,
const uint256  hashBlock,
UniValue entry 
)

Definition at line 64 of file rawtransaction.cpp.

Referenced by blockToJSON(), decoderawtransaction(), and getrawtransaction().

◆ verifychain()

UniValue verifychain ( const UniValue params,
bool  fHelp 
)

Definition at line 671 of file blockchain.cpp.

Referenced by blockchain.BlockchainTest::run_test().