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

Method Serialize

src/script/sign.h:567–596  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565
566 template <typename Stream>
567 inline void Serialize(Stream& s) const {
568
569 // magic bytes
570 s << PSBT_MAGIC_BYTES;
571
572 // unsigned tx flag
573 SerializeToVector(s, PSBT_GLOBAL_UNSIGNED_TX);
574
575 // Write serialized tx to a stream
576 OverrideStream<Stream> os(&s, s.GetType(), s.GetVersion() | SERIALIZE_TRANSACTION_NO_WITNESS);
577 SerializeToVector(os, *tx);
578
579 // Write the unknown things
580 for (auto& entry : unknown) {
581 s << entry.first;
582 s << entry.second;
583 }
584
585 // Separator
586 s << PSBT_SEPARATOR;
587
588 // Write inputs
589 for (const PSBTInput& input : inputs) {
590 s << input;
591 }
592 // Write outputs
593 for (const PSBTOutput& output : outputs) {
594 s << output;
595 }
596 }
597
598
599 template <typename Stream>

Callers

nothing calls this directly

Calls 3

SerializeToVectorFunction · 0.85
GetTypeMethod · 0.45
GetVersionMethod · 0.45

Tested by

no test coverage detected