mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-29 14:59:39 -04:00
doc: Add docstrings for ConnectBlock and SpendBlock
This commit is contained in:
parent
8221e89ac4
commit
76a8f22c5c
1 changed files with 25 additions and 0 deletions
|
@ -706,9 +706,34 @@ public:
|
||||||
// Block (dis)connection on a given view:
|
// Block (dis)connection on a given view:
|
||||||
DisconnectResult DisconnectBlock(const CBlock& block, const CBlockIndex* pindex, CCoinsViewCache& view)
|
DisconnectResult DisconnectBlock(const CBlock& block, const CBlockIndex* pindex, CCoinsViewCache& view)
|
||||||
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Validates the block against the coins in the blockundo data, writes the
|
||||||
|
* undo data, and raises the block validity in the block index.
|
||||||
|
*
|
||||||
|
* @param[in] block The block to be validated
|
||||||
|
* @param[in] block_hash Hash of block
|
||||||
|
* @param[in] blockundo Has to contain all coins spent by block. Written to disk on successful validation
|
||||||
|
* @param[out] state This may be set to an Error state if any error occurred validating block
|
||||||
|
* @param[out] pindex Points to the block map entry associated with block. On successful validation, raises the block validity
|
||||||
|
* @param[in] fJustCheck If set, no data is written to disk and pindex's validity is not raised
|
||||||
|
*/
|
||||||
bool ConnectBlock(const CBlock& block, const uint256& block_hash, const CBlockUndo& blockundo, BlockValidationState& state,
|
bool ConnectBlock(const CBlock& block, const uint256& block_hash, const CBlockUndo& blockundo, BlockValidationState& state,
|
||||||
CBlockIndex* pindex, bool fJustCheck = false) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
CBlockIndex* pindex, bool fJustCheck = false) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Spends the coins associated with a block. First checks that the block
|
||||||
|
* contains no duplicate transactions (BIP30), then for each transaction in
|
||||||
|
* the block checks that the outputs it is spending exist, spends them, and
|
||||||
|
* populates the CBlockUndo data structure.
|
||||||
|
*
|
||||||
|
* @param[in] block The block to be spent
|
||||||
|
* @param[in] pindex Points to the block map entry associated with block
|
||||||
|
* @param[in] block_hash Hash of block
|
||||||
|
* @param[out] view Its coins are spent and used to populate CBlockUndo during its execution
|
||||||
|
* @param[out] state This may be set to an Error state if any error occurred processing them
|
||||||
|
* @param[out] blockundo Coins consumed by the block are added to it.
|
||||||
|
*/
|
||||||
bool SpendBlock(const CBlock& block, const CBlockIndex* pindex, const uint256& block_hash,
|
bool SpendBlock(const CBlock& block, const CBlockIndex* pindex, const uint256& block_hash,
|
||||||
CCoinsViewCache& view, BlockValidationState& state, CBlockUndo& blockundo) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
CCoinsViewCache& view, BlockValidationState& state, CBlockUndo& blockundo) EXCLUSIVE_LOCKS_REQUIRED(cs_main);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue