Changeset View
Changeset View
Standalone View
Standalone View
src/primitives/transaction.h
Show First 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | public: | ||||
* seconds is performed by multiplying by 512 = 2^9, or equivalently | * seconds is performed by multiplying by 512 = 2^9, or equivalently | ||||
* shifting up by 9 bits. | * shifting up by 9 bits. | ||||
*/ | */ | ||||
static const int SEQUENCE_LOCKTIME_GRANULARITY = 9; | static const int SEQUENCE_LOCKTIME_GRANULARITY = 9; | ||||
CTxIn() { nSequence = SEQUENCE_FINAL; } | CTxIn() { nSequence = SEQUENCE_FINAL; } | ||||
explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn = CScript(), | explicit CTxIn(COutPoint prevoutIn, CScript scriptSigIn = CScript(), | ||||
uint32_t nSequenceIn = SEQUENCE_FINAL); | uint32_t nSequenceIn = SEQUENCE_FINAL) | ||||
: prevout(prevoutIn), scriptSig(scriptSigIn), nSequence(nSequenceIn) {} | |||||
CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn = CScript(), | CTxIn(uint256 hashPrevTx, uint32_t nOut, CScript scriptSigIn = CScript(), | ||||
uint32_t nSequenceIn = SEQUENCE_FINAL); | uint32_t nSequenceIn = SEQUENCE_FINAL) | ||||
: CTxIn(COutPoint(hashPrevTx, nOut), scriptSigIn, nSequenceIn) {} | |||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
READWRITE(prevout); | READWRITE(prevout); | ||||
READWRITE(scriptSig); | READWRITE(scriptSig); | ||||
READWRITE(nSequence); | READWRITE(nSequence); | ||||
Show All 15 Lines | |||||
*/ | */ | ||||
class CTxOut { | class CTxOut { | ||||
public: | public: | ||||
Amount nValue; | Amount nValue; | ||||
CScript scriptPubKey; | CScript scriptPubKey; | ||||
CTxOut() { SetNull(); } | CTxOut() { SetNull(); } | ||||
CTxOut(const Amount &nValueIn, CScript scriptPubKeyIn); | CTxOut(Amount nValueIn, CScript scriptPubKeyIn) | ||||
: nValue(nValueIn), scriptPubKey(scriptPubKeyIn) {} | |||||
ADD_SERIALIZE_METHODS; | ADD_SERIALIZE_METHODS; | ||||
template <typename Stream, typename Operation> | template <typename Stream, typename Operation> | ||||
inline void SerializationOp(Stream &s, Operation ser_action) { | inline void SerializationOp(Stream &s, Operation ser_action) { | ||||
READWRITE(nValue); | READWRITE(nValue); | ||||
READWRITE(scriptPubKey); | READWRITE(scriptPubKey); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 230 Lines • Show Last 20 Lines |