Repository: bitcoin/bitcoin
File: src/validationinterface.h (C/C++)

Code before:
     */
    virtual void BlockDisconnected(const std::shared_ptr<const CBlock> &block, const CBlockIndex* pindex) {}
    /**
     * Notifies listeners of the new active block chain on-disk.
     *
     * Prior to this callback, any updates are not guaranteed to persist on disk
     * (ie clients need to handle shutdown/restart safety by being able to
     * understand when some updates were lost due to unclean shutdown).
     *
     * When this callback is invoked, the validation changes done by any prior
     * callback are guaranteed to exist on disk and survive a restart, including
     * an unclean shutdown.
     *
     * Provides a locator describing the best chain, which is likely useful for
     * storing current state on disk in client DBs.
     *
     * Called on a background thread.
     */
    virtual void ChainStateFlushed(ChainstateRole role, const CBlockLocator &locator) {}
    /**
     * Notifies listeners of a block validation result.
     * If the provided BlockValidationState IsValid, the provided block
     * is guaranteed to be the current best block at the time the
     * callback was generated (not necessarily now).
     */
    virtual void BlockChecked(const CBlock&, const BlockValidationState&) {}
    /**
     * Notifies listeners that a block which builds directly on our current tip
     * has been received and connected to the headers tree, though not validated yet.
     */
    virtual void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& block) {};
    friend class ValidationSignals;
    friend class ValidationInterfaceTest;
};

class ValidationSignalsImpl;
class ValidationSignals {
private:
    std::unique_ptr<ValidationSignalsImpl> m_internals;

public:
    // The task runner will block validation if it calls its insert method's
    // func argument synchronously. In this class func contains a loop that
    // dispatches a single validation event to all subscribers sequentially.
    explicit ValidationSignals(std::unique_ptr<util::TaskRunnerInterface> task_runner);

    ~ValidationSignals();

    /** Call any remaining callbacks on the calling thread */
    void FlushBackgroundCallbacks();


Review comment (suggestion):
```suggestion
    virtual void BlockChecked(const std::shared_ptr<const CBlock>, const BlockValidationState&) {}
```

Code after:
     */
    virtual void BlockDisconnected(const std::shared_ptr<const CBlock> &block, const CBlockIndex* pindex) {}
    /**
     * Notifies listeners of the new active block chain on-disk.
     *
     * Prior to this callback, any updates are not guaranteed to persist on disk
     * (ie clients need to handle shutdown/restart safety by being able to
     * understand when some updates were lost due to unclean shutdown).
     *
     * When this callback is invoked, the validation changes done by any prior
     * callback are guaranteed to exist on disk and survive a restart, including
     * an unclean shutdown.
     *
     * Provides a locator describing the best chain, which is likely useful for
     * storing current state on disk in client DBs.
     *
     * Called on a background thread.
     */
    virtual void ChainStateFlushed(ChainstateRole role, const CBlockLocator &locator) {}
    /**
     * Notifies listeners of a block validation result.
     * If the provided BlockValidationState IsValid, the provided block
     * is guaranteed to be the current best block at the time the
     * callback was generated (not necessarily now).
     */
    virtual void BlockChecked(const std::shared_ptr<const CBlock>&, const BlockValidationState&) {}
    /**
     * Notifies listeners that a block which builds directly on our current tip
     * has been received and connected to the headers tree, though not validated yet.
     */
    virtual void NewPoWValidBlock(const CBlockIndex *pindex, const std::shared_ptr<const CBlock>& block) {};
    friend class ValidationSignals;
    friend class ValidationInterfaceTest;
};

class ValidationSignalsImpl;
class ValidationSignals {
private:
    std::unique_ptr<ValidationSignalsImpl> m_internals;

public:
    // The task runner will block validation if it calls its insert method's
    // func argument synchronously. In this class func contains a loop that
    // dispatches a single validation event to all subscribers sequentially.
    explicit ValidationSignals(std::unique_ptr<util::TaskRunnerInterface> task_runner);

    ~ValidationSignals();

    /** Call any remaining callbacks on the calling thread */
    void FlushBackgroundCallbacks();