| 341 | return true; |
| 342 | } |
| 343 | bool Expand(int pos, const SigningProvider& arg, std::vector<CScript>& output_scripts, FlatSigningProvider& out) const override |
| 344 | { |
| 345 | CPubKey key; |
| 346 | if (!m_provider->GetPubKey(pos, arg, key)) return false; |
| 347 | CKeyID keyid = key.GetID(); |
| 348 | { |
| 349 | CScript p2pk = GetScriptForRawPubKey(key); |
| 350 | CScript p2pkh = GetScriptForDestination(keyid); |
| 351 | output_scripts = std::vector<CScript>{std::move(p2pk), std::move(p2pkh)}; |
| 352 | out.pubkeys.emplace(keyid, key); |
| 353 | } |
| 354 | if (key.IsCompressed()) { |
| 355 | CScript p2wpkh = GetScriptForDestination(WitnessV0KeyHash(keyid)); |
| 356 | CScriptID p2wpkh_id(p2wpkh); |
| 357 | CScript p2sh_p2wpkh = GetScriptForDestination(p2wpkh_id); |
| 358 | out.scripts.emplace(p2wpkh_id, p2wpkh); |
| 359 | output_scripts.push_back(std::move(p2wpkh)); |
| 360 | output_scripts.push_back(std::move(p2sh_p2wpkh)); |
| 361 | } |
| 362 | return true; |
| 363 | } |
| 364 | }; |
| 365 | |
| 366 | //////////////////////////////////////////////////////////////////////////// |
nothing calls this directly
no test coverage detected