Bitcoin Core  31.0.0
P2P Digital Currency
signet.h
Go to the documentation of this file.
1 // Copyright (c) 2019-present 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 <primitives/block.h>
10 
11 #include <optional>
12 
13 class CScript;
14 namespace Consensus {
15 struct Params;
16 } // namespace Consensus
17 
21 bool CheckSignetBlockSolution(const CBlock& block, const Consensus::Params& consensusParams);
22 
30 class SignetTxs {
31  template<class T1, class T2>
32  SignetTxs(const T1& to_spend, const T2& to_sign) : m_to_spend{to_spend}, m_to_sign{to_sign} { }
33 
34 public:
35  static std::optional<SignetTxs> Create(const CBlock& block, const CScript& challenge);
36 
39 };
40 
41 #endif // BITCOIN_SIGNET_H
static std::optional< SignetTxs > Create(const CBlock &block, const CScript &challenge)
Definition: signet.cpp:70
Definition: block.h:73
SignetTxs(const T1 &to_spend, const T2 &to_sign)
Definition: signet.h:32
bool CheckSignetBlockSolution(const CBlock &block, const Consensus::Params &consensusParams)
Extract signature and check whether a block has a valid solution.
Definition: signet.cpp:126
Transaction validation functions.
const CTransaction m_to_sign
Definition: signet.h:38
Parameters that influence chain consensus.
Definition: params.h:84
const CChainParams & Params()
Return the currently selected parameters.
Serialized script, used inside transaction inputs and outputs.
Definition: script.h:404
The basic transaction that is broadcasted on the network and contained in blocks. ...
Definition: transaction.h:280
Generate the signet tx corresponding to the given block.
Definition: signet.h:30
const CTransaction m_to_spend
Definition: signet.h:37