| 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> |
nothing calls this directly
no test coverage detected