veriblock-pop-cpp
C++11 Libraries for leveraging VeriBlock Proof-Of-Proof blockchain technology.
state_corrupted.hpp
1// Copyright (c) 2019-2022 Xenios SEZC
2// https://www.veriblock.org
3// Distributed under the MIT software license, see the accompanying
4// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
5
6#ifndef VERIBLOCK_POP_CPP_STATE_CORRUPTED_HPP
7#define VERIBLOCK_POP_CPP_STATE_CORRUPTED_HPP
8
9#include <exception>
10#include <veriblock/pop/blockchain/block_index.hpp>
11#include <veriblock/pop/entities/vbkblock.hpp>
12
13namespace altintegration {
14
19struct StateCorruptedException : public std::domain_error {
20 StateCorruptedException(const std::string& msg) : std::domain_error(msg) {}
21
22 template <typename Block>
24 ValidationState& state)
26 format("Error loading payloads from {} block {}, reason={}",
27 Block::name(),
28 index.toPrettyString(),
29 state.toString())) {}
30};
31
32} // namespace altintegration
33
34#endif // VERIBLOCK_POP_CPP_STATE_CORRUPTED_HPP
Class that is used for storing validation state.
Defines logging helpers.
Definition: block.hpp:14
A node in a block tree.
Definition: block_index.hpp:31
Is thrown only when this library detects POP-related state corruption, and can't recover.