MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / SerializeInput

Method SerializeInput

src/script/interpreter.cpp:1306–1324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1304 /** Serialize an input of txTo */
1305 template<typename S>
1306 void SerializeInput(S &s, unsigned int nInput) const {
1307 // In case of SIGHASH_ANYONECANPAY, only the input being signed is serialized
1308 if (fAnyoneCanPay)
1309 nInput = nIn;
1310 // Serialize the prevout
1311 ::Serialize(s, txTo.vin[nInput].prevout);
1312 // Serialize the script
1313 if (nInput != nIn)
1314 // Blank out other inputs' signatures
1315 ::Serialize(s, CScript());
1316 else
1317 SerializeScriptCode(s);
1318 // Serialize the nSequence
1319 if (nInput != nIn && (fHashSingle || fHashNone))
1320 // let the others update at will
1321 ::Serialize(s, int32_t{0});
1322 else
1323 ::Serialize(s, txTo.vin[nInput].nSequence);
1324 }
1325
1326 /** Serialize an output of txTo */
1327 template<typename S>

Callers

nothing calls this directly

Calls 2

CScriptClass · 0.70
SerializeFunction · 0.50

Tested by

no test coverage detected