forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
types.h
66 lines (60 loc) · 2.18 KB
/
types.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (c) 2010-2021 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
//! @file node/types.h is a home for public enum and struct type definitions
//! that are used internally by node code, but also used externally by wallet,
//! mining or GUI code.
//!
//! This file is intended to define only simple types that do not have external
//! dependencies. More complicated types should be defined in dedicated header
//! files.
#ifndef BITCOIN_NODE_TYPES_H
#define BITCOIN_NODE_TYPES_H
#include <cstddef>
#include <script/script.h>
namespace node {
enum class TransactionError {
OK, //!< No error
MISSING_INPUTS,
ALREADY_IN_UTXO_SET,
MEMPOOL_REJECTED,
MEMPOOL_ERROR,
MAX_FEE_EXCEEDED,
MAX_BURN_EXCEEDED,
INVALID_PACKAGE,
};
struct BlockCreateOptions {
/**
* Set false to omit mempool transactions
*/
bool use_mempool{true};
/**
* The maximum additional weight which the pool will add to the coinbase
* scriptSig, witness and outputs. This must include any additional
* weight needed for larger CompactSize encoded lengths.
*/
size_t coinbase_max_additional_weight{4000};
/**
* The maximum additional sigops which the pool will add in coinbase
* transaction outputs.
*/
size_t coinbase_output_max_additional_sigops{400};
/**
* Script to put in the coinbase transaction. The default is an
* anyone-can-spend dummy.
*
* Should only be used for tests, when the default doesn't suffice.
*
* Note that higher level code like the getblocktemplate RPC may omit the
* coinbase transaction entirely. It's instead constructed by pool software
* using fields like coinbasevalue, coinbaseaux and default_witness_commitment.
* This software typically also controls the payout outputs, even for solo
* mining.
*
* The size and sigops are not checked against
* coinbase_max_additional_weight and coinbase_output_max_additional_sigops.
*/
CScript coinbase_output_script{CScript() << OP_TRUE};
};
} // namespace node
#endif // BITCOIN_NODE_TYPES_H