diff options
author | Antoine Poinsot <darosior@protonmail.com> | 2023-02-11 12:57:52 +0100 |
---|---|---|
committer | Antoine Poinsot <darosior@protonmail.com> | 2023-02-13 15:39:25 +0100 |
commit | 6c7a17a8e0eec377f83ed1399f003ae70b898270 (patch) | |
tree | 3c3d8a5eb4d3078e287c27d6921a2c55611d65e4 /src/psbt.cpp | |
parent | 840a396029316896beda46600aec3c1af09a899c (diff) | |
download | bitcoin-6c7a17a8e0eec377f83ed1399f003ae70b898270.tar.xz |
psbt: support externally provided preimages for Miniscript satisfaction
Co-Authored-By: Andrew Chow <github@achow101.com>
Diffstat (limited to 'src/psbt.cpp')
-rw-r--r-- | src/psbt.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/psbt.cpp b/src/psbt.cpp index 461987c503..701b085c20 100644 --- a/src/psbt.cpp +++ b/src/psbt.cpp @@ -132,6 +132,18 @@ void PSBTInput::FillSignatureData(SignatureData& sigdata) const for (const auto& [pubkey, leaf_origin] : m_tap_bip32_paths) { sigdata.taproot_misc_pubkeys.emplace(pubkey, leaf_origin); } + for (const auto& [hash, preimage] : ripemd160_preimages) { + sigdata.ripemd160_preimages.emplace(std::vector<unsigned char>(hash.begin(), hash.end()), preimage); + } + for (const auto& [hash, preimage] : sha256_preimages) { + sigdata.sha256_preimages.emplace(std::vector<unsigned char>(hash.begin(), hash.end()), preimage); + } + for (const auto& [hash, preimage] : hash160_preimages) { + sigdata.hash160_preimages.emplace(std::vector<unsigned char>(hash.begin(), hash.end()), preimage); + } + for (const auto& [hash, preimage] : hash256_preimages) { + sigdata.hash256_preimages.emplace(std::vector<unsigned char>(hash.begin(), hash.end()), preimage); + } } void PSBTInput::FromSignatureData(const SignatureData& sigdata) |