MCPcopy Create free account
hub / github.com/bitcoinxt/bitcoinxt / Serialize

Method Serialize

src/script/interpreter.cpp:1120–1135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1118 /** Serialize txTo */
1119 template<typename S>
1120 void Serialize(S &s, int nType, int nVersion) const {
1121 // Serialize nVersion
1122 ::Serialize(s, txTo.nVersion, nType, nVersion);
1123 // Serialize vin
1124 unsigned int nInputs = fAnyoneCanPay ? 1 : txTo.vin.size();
1125 ::WriteCompactSize(s, nInputs);
1126 for (unsigned int nInput = 0; nInput < nInputs; nInput++)
1127 SerializeInput(s, nInput, nType, nVersion);
1128 // Serialize vout
1129 unsigned int nOutputs = fHashNone ? 0 : (fHashSingle ? nIn+1 : txTo.vout.size());
1130 ::WriteCompactSize(s, nOutputs);
1131 for (unsigned int nOutput = 0; nOutput < nOutputs; nOutput++)
1132 SerializeOutput(s, nOutput, nType, nVersion);
1133 // Serialize nLockTime
1134 ::Serialize(s, txTo.nLockTime, nType, nVersion);
1135 }
1136};
1137
1138uint256 GetPrevoutHash(const CTransaction &txTo) {

Callers

nothing calls this directly

Calls 3

WriteCompactSizeFunction · 0.85
SerializeFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected