MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / GetDescriptor

Function GetDescriptor

src/wallet/spend.cpp:112–123  ·  view source on GitHub ↗

Infer a descriptor for the given output script. */

Source from the content-addressed store, hash-verified

110
111/** Infer a descriptor for the given output script. */
112static std::unique_ptr<Descriptor> GetDescriptor(const CWallet* wallet, const CCoinControl* coin_control,
113 const CScript script_pubkey)
114{
115 MultiSigningProvider providers;
116 for (const auto spkman: wallet->GetScriptPubKeyMans(script_pubkey)) {
117 providers.AddProvider(spkman->GetSolvingProvider(script_pubkey));
118 }
119 if (coin_control) {
120 providers.AddProvider(std::make_unique<FlatSigningProvider>(coin_control->m_external_provider));
121 }
122 return InferDescriptor(script_pubkey, providers);
123}
124
125/** Infer the maximum size of this input after it will be signed. */
126static std::optional<int64_t> GetSignedTxinWeight(const CWallet* wallet, const CCoinControl* coin_control,

Callers 2

GetSignedTxinWeightFunction · 0.85

Calls 4

InferDescriptorFunction · 0.85
GetScriptPubKeyMansMethod · 0.80
AddProviderMethod · 0.80
GetSolvingProviderMethod · 0.45

Tested by

no test coverage detected