Bitcoin Core 28.99.0
P2P Digital Currency
signet.h
Go to the documentation of this file.
1// Copyright (c) 2019-2021 The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_SIGNET_H
6#define BITCOIN_SIGNET_H
7
8#include <consensus/params.h>
9#include <primitives/block.h>
11
12#include <optional>
13
17bool CheckSignetBlockSolution(const CBlock& block, const Consensus::Params& consensusParams);
18
26class SignetTxs {
27 template<class T1, class T2>
28 SignetTxs(const T1& to_spend, const T2& to_sign) : m_to_spend{to_spend}, m_to_sign{to_sign} { }
29
30public:
31 static std::optional<SignetTxs> Create(const CBlock& block, const CScript& challenge);
32
35};
36
37#endif // BITCOIN_SIGNET_H
Definition: block.h:69
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:415
The basic transaction that is broadcasted on the network and contained in blocks.
Definition: transaction.h:296
Generate the signet tx corresponding to the given block.
Definition: signet.h:26
SignetTxs(const T1 &to_spend, const T2 &to_sign)
Definition: signet.h:28
static std::optional< SignetTxs > Create(const CBlock &block, const CScript &challenge)
Definition: signet.cpp:69
const CTransaction m_to_sign
Definition: signet.h:34
const CTransaction m_to_spend
Definition: signet.h:33
bool CheckSignetBlockSolution(const CBlock &block, const Consensus::Params &consensusParams)
Extract signature and check whether a block has a valid solution.
Definition: signet.cpp:125
Parameters that influence chain consensus.
Definition: params.h:74