Bitcoin Core  0.20.99
P2P Digital Currency
signet.h
Go to the documentation of this file.
1 // Copyright (c) 2019-2020 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>
10 #include <primitives/transaction.h>
11 
12 #include <optional.h>
13 
17 bool CheckSignetBlockSolution(const CBlock& block, const Consensus::Params& consensusParams);
18 
26 class 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 
30 public:
31  static Optional<SignetTxs> Create(const CBlock& block, const CScript& challenge);
32 
35 };
36 
37 #endif // BITCOIN_SIGNET_H
Definition: block.h:62
SignetTxs(const T1 &to_spend, const T2 &to_sign)
Definition: signet.h:28
bool CheckSignetBlockSolution(const CBlock &block, const Consensus::Params &consensusParams)
Extract signature and check whether a block has a valid solution.
Definition: signet.cpp:124
const CTransaction m_to_sign
Definition: signet.h:34
Parameters that influence chain consensus.
Definition: params.h:46
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:259
boost::optional< T > Optional
Substitute for C++17 std::optional.
Definition: optional.h:14
Generate the signet tx corresponding to the given block.
Definition: signet.h:26
static Optional< SignetTxs > Create(const CBlock &block, const CScript &challenge)
Definition: signet.cpp:68
const CTransaction m_to_spend
Definition: signet.h:33