Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.cpp
Show First 20 Lines • Show All 1,336 Lines • ▼ Show 20 Lines | template <typename S> void Serialize(S &s) const { | ||||
} | } | ||||
// Serialize nLockTime | // Serialize nLockTime | ||||
::Serialize(s, txTo.nLockTime); | ::Serialize(s, txTo.nLockTime); | ||||
} | } | ||||
}; | }; | ||||
uint256 GetPrevoutHash(const CTransaction &txTo) { | uint256 GetPrevoutHash(const CTransaction &txTo) { | ||||
CHashWriter ss(SER_GETHASH, 0); | CHashWriter ss(SER_GETHASH, 0); | ||||
for (size_t n = 0; n < txTo.vin.size(); n++) { | for (const auto &txin : txTo.vin) { | ||||
ss << txTo.vin[n].prevout; | ss << txin.prevout; | ||||
} | } | ||||
return ss.GetHash(); | return ss.GetHash(); | ||||
} | } | ||||
uint256 GetSequenceHash(const CTransaction &txTo) { | uint256 GetSequenceHash(const CTransaction &txTo) { | ||||
CHashWriter ss(SER_GETHASH, 0); | CHashWriter ss(SER_GETHASH, 0); | ||||
for (size_t n = 0; n < txTo.vin.size(); n++) { | for (const auto &txin : txTo.vin) { | ||||
ss << txTo.vin[n].nSequence; | ss << txin.nSequence; | ||||
} | } | ||||
return ss.GetHash(); | return ss.GetHash(); | ||||
} | } | ||||
uint256 GetOutputsHash(const CTransaction &txTo) { | uint256 GetOutputsHash(const CTransaction &txTo) { | ||||
CHashWriter ss(SER_GETHASH, 0); | CHashWriter ss(SER_GETHASH, 0); | ||||
for (size_t n = 0; n < txTo.vout.size(); n++) { | for (const auto &txout : txTo.vout) { | ||||
ss << txTo.vout[n]; | ss << txout; | ||||
} | } | ||||
return ss.GetHash(); | return ss.GetHash(); | ||||
} | } | ||||
} // namespace | } // namespace | ||||
PrecomputedTransactionData::PrecomputedTransactionData( | PrecomputedTransactionData::PrecomputedTransactionData( | ||||
const CTransaction &txTo) { | const CTransaction &txTo) { | ||||
▲ Show 20 Lines • Show All 301 Lines • Show Last 20 Lines |