| 442 | |
| 443 | template <typename Stream> |
| 444 | inline void Serialize(Stream& s) const { |
| 445 | // Write the redeem script |
| 446 | if (!redeem_script.empty()) { |
| 447 | SerializeToVector(s, PSBT_OUT_REDEEMSCRIPT); |
| 448 | s << redeem_script; |
| 449 | } |
| 450 | |
| 451 | // Write the witness script |
| 452 | if (!witness_script.empty()) { |
| 453 | SerializeToVector(s, PSBT_OUT_WITNESSSCRIPT); |
| 454 | s << witness_script; |
| 455 | } |
| 456 | |
| 457 | // Write any hd keypaths |
| 458 | SerializeHDKeypaths(s, hd_keypaths, PSBT_OUT_BIP32_DERIVATION); |
| 459 | |
| 460 | // Write unknown things |
| 461 | for (auto& entry : unknown) { |
| 462 | s << entry.first; |
| 463 | s << entry.second; |
| 464 | } |
| 465 | |
| 466 | s << PSBT_SEPARATOR; |
| 467 | } |
| 468 | |
| 469 | |
| 470 | template <typename Stream> |
nothing calls this directly
no test coverage detected