diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2014-10-28 07:41:33 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2014-10-28 08:15:14 +0000 |
commit | 1bea2bbddce6abaf2640c4aab56ad08de53c4b90 (patch) | |
tree | 9e9d2911a1ac218751a83b91d2813d3c9f27e834 /src/main.h | |
parent | d29a2917ff73f7e82b32bd94a87df3ee211a27c2 (diff) |
Rename ProcessBlock to ProcessNewBlock to indicate change of behaviour, and document it
Diffstat (limited to 'src/main.h')
-rw-r--r-- | src/main.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main.h b/src/main.h index 69be26a4ee..9d08b3c09f 100644 --- a/src/main.h +++ b/src/main.h @@ -148,8 +148,16 @@ void RegisterNodeSignals(CNodeSignals& nodeSignals); /** Unregister a network node */ void UnregisterNodeSignals(CNodeSignals& nodeSignals); -/** Process an incoming block */ -bool ProcessBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL); +/** Process an incoming block. This only returns after the best known valid + block is made active. Note that it does not, however, guarantee that the + specific block passed to it has been checked for validity! + @param[out] state This may be set to an Error state if any error occurred processing it, including during validation/connection/etc of otherwise unrelated blocks during reorganisation; or it may be set to an Invalid state iff pblock is itself invalid (but this is not guaranteed even when the block is checked). If you want to *possibly* get feedback on whether pblock is valid, you must also install a CValidationInterface - this will have its BlockChecked method called whenever *any* block completes validation. + @param[in] pfrom The node which we are receiving the block from; it is added to mapBlockSource and may be penalised if the block is invalid. + @param[in] pblock The block we want to process. + @param[out] dbp If pblock is stored to disk (or already there), this will be set to its location. + @return True if state.IsValid() +*/ +bool ProcessNewBlock(CValidationState &state, CNode* pfrom, CBlock* pblock, CDiskBlockPos *dbp = NULL); /** Check whether enough disk space is available for an incoming block */ bool CheckDiskSpace(uint64_t nAdditionalBytes = 0); /** Open a block file (blk?????.dat) */ |