An input of a transaction. It contains the location of the previous * transaction's output that it claims and a signature that matches the * output's public key. */
| 88 | * output's public key. |
| 89 | */ |
| 90 | class CTxIn |
| 91 | { |
| 92 | public: |
| 93 | COutPoint prevout; |
| 94 | CScript scriptSig; |
| 95 | uint32_t nSequence; |
| 96 | |
| 97 | // |
| 98 | // ELEMENTS: |
| 99 | |
| 100 | CAssetIssuance assetIssuance; |
| 101 | |
| 102 | /* If this is set to true, the input is interpreted as a |
| 103 | * peg-in claim and processed as such */ |
| 104 | bool m_is_pegin = false; |
| 105 | |
| 106 | // END ELEMENTS |
| 107 | // |
| 108 | |
| 109 | /** |
| 110 | * Setting nSequence to this value for every input in a transaction |
| 111 | * disables nLockTime/IsFinalTx(). |
| 112 | * It fails OP_CHECKLOCKTIMEVERIFY/CheckLockTime() for any input that has |
| 113 | * it set (BIP 65). |
| 114 | * It has SEQUENCE_LOCKTIME_DISABLE_FLAG set (BIP 68/112). |
| 115 | */ |
| 116 | static const uint32_t SEQUENCE_FINAL = 0xffffffff; |
| 117 | /** |
| 118 | * This is the maximum sequence number that enables both nLockTime and |
| 119 | * OP_CHECKLOCKTIMEVERIFY (BIP 65). |
| 120 | * It has SEQUENCE_LOCKTIME_DISABLE_FLAG set (BIP 68/112). |
| 121 | */ |
| 122 | static const uint32_t MAX_SEQUENCE_NONFINAL{SEQUENCE_FINAL - 1}; |
| 123 | |
| 124 | // Below flags apply in the context of BIP 68. BIP 68 requires the tx |
| 125 | // version to be set to 2, or higher. |
| 126 | /** |
| 127 | * If this flag is set, CTxIn::nSequence is NOT interpreted as a |
| 128 | * relative lock-time. |
| 129 | * It skips SequenceLocks() for any input that has it set (BIP 68). |
| 130 | * It fails OP_CHECKSEQUENCEVERIFY/CheckSequence() for any input that has |
| 131 | * it set (BIP 112). |
| 132 | */ |
| 133 | static const uint32_t SEQUENCE_LOCKTIME_DISABLE_FLAG = (1U << 31); |
| 134 | |
| 135 | /** |
| 136 | * If CTxIn::nSequence encodes a relative lock-time and this flag |
| 137 | * is set, the relative lock-time has units of 512 seconds, |
| 138 | * otherwise it specifies blocks with a granularity of 1. */ |
| 139 | static const uint32_t SEQUENCE_LOCKTIME_TYPE_FLAG = (1 << 22); |
| 140 | |
| 141 | /** |
| 142 | * If CTxIn::nSequence encodes a relative lock-time, this mask is |
| 143 | * applied to extract that lock-time from the sequence field. */ |
| 144 | static const uint32_t SEQUENCE_LOCKTIME_MASK = 0x0000ffff; |
| 145 | |
| 146 | /** |
| 147 | * In order to use the same number of bits to encode roughly the |