| 140 | } |
| 141 | |
| 142 | std::set<std::pair<CPubKey, KeyOriginInfo>> GetKeyOriginData(const FlatSigningProvider& provider, int flags) { |
| 143 | std::set<CKeyID> ignored; |
| 144 | if (flags & MUSIG) { |
| 145 | for (const auto& [_, part_pks] : provider.aggregate_pubkeys) { |
| 146 | for (const auto& pk : part_pks) { |
| 147 | ignored.insert(pk.GetID()); |
| 148 | } |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | std::set<std::pair<CPubKey, KeyOriginInfo>> ret; |
| 153 | for (const auto& [keyid, data] : provider.origins) { |
| 154 | if (ignored.contains(keyid)) continue; |
| 155 | if (flags & XONLY_KEYS) { |
| 156 | unsigned char bytes[33]; |
| 157 | BOOST_CHECK_EQUAL(data.first.size(), 33); |
| 158 | std::copy(data.first.begin(), data.first.end(), bytes); |
| 159 | bytes[0] = 0x02; |
| 160 | CPubKey norm_pubkey{bytes}; |
| 161 | KeyOriginInfo norm_origin = data.second; |
| 162 | std::fill(std::begin(norm_origin.fingerprint), std::end(norm_origin.fingerprint), 0); // fingerprints don't necessarily match. |
| 163 | ret.emplace(norm_pubkey, norm_origin); |
| 164 | } else { |
| 165 | ret.insert(data); |
| 166 | } |
| 167 | } |
| 168 | return ret; |
| 169 | } |
| 170 | |
| 171 | void DoCheck(std::string prv, std::string pub, const std::string& norm_pub, int flags, |
| 172 | const std::vector<std::vector<std::string>>& scripts, const std::optional<OutputType>& type, std::optional<uint256> op_desc_id = std::nullopt, |