refactor: tidy up implementation of special tx manager (#5172)

## Issue being fixed or feature implemented
It is preparation work for #5026 (moved out a refactoring as a new pull
request)

## What was done?
 - tidy up header dependencies
 - move general code to proper headers


## How Has This Been Tested?
Run unit/functional tests

## Breaking Changes
No breaking changes

## Checklist:
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
This commit is contained in:
Konstantin Akimov 2023-02-03 12:22:51 +07:00 committed by GitHub
parent 9a03334893
commit 90d888dc31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 10 deletions

View File

@ -13,21 +13,13 @@
#include <key_io.h>
#include <netaddress.h>
#include <pubkey.h>
#include <tinyformat.h>
#include <univalue.h>
class CBlockIndex;
class CCoinsViewCache;
class CValidationState;
struct maybe_error{
bool did_err{false};
ValidationInvalidReason reason{ValidationInvalidReason::CONSENSUS};
std::string_view error_str;
constexpr maybe_error() = default;
constexpr maybe_error(ValidationInvalidReason reasonIn, std::string_view err): did_err(true), reason(reasonIn), error_str(err) {};
};
class CProRegTx
{
public:

View File

@ -5,14 +5,25 @@
#ifndef BITCOIN_EVO_SPECIALTX_H
#define BITCOIN_EVO_SPECIALTX_H
#include <consensus/validation.h>
#include <primitives/transaction.h>
#include <serialize.h>
#include <streams.h>
#include <uint256.h>
#include <version.h>
#include <string_view>
#include <vector>
struct maybe_error {
bool did_err{false};
ValidationInvalidReason reason{ValidationInvalidReason::CONSENSUS};
std::string_view error_str;
constexpr maybe_error() = default;
constexpr maybe_error(ValidationInvalidReason reasonIn, std::string_view err): did_err(true), reason(reasonIn), error_str(err) {};
};
template <typename T>
inline bool GetTxPayload(const std::vector<unsigned char>& payload, T& obj)
{

View File

@ -2,7 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <evo/specialtx.h>
#include <evo/specialtxman.h>
#include <chainparams.h>
#include <consensus/validation.h>

View File

@ -13,6 +13,9 @@ class CBlock;
class CBlockIndex;
class CCoinsViewCache;
class CValidationState;
namespace llmq {
class CQuorumBlockProcessor;
} // namespace llmq
extern CCriticalSection cs_main;