mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-21 12:18:13 +02:00
Replace GetSigningProvider with GetSolvingProvider
Not all ScriptPubKeyMans will be able to provide private keys, but pubkeys and scripts should be. So only provide public-only SigningProviders, i.e. ones that can help with Solving.
This commit is contained in:
@@ -2962,7 +2962,7 @@ static UniValue listunspent(const JSONRPCRequest& request)
|
||||
entry.pushKV("label", i->second.name);
|
||||
}
|
||||
|
||||
std::unique_ptr<SigningProvider> provider = pwallet->GetSigningProvider(scriptPubKey);
|
||||
std::unique_ptr<SigningProvider> provider = pwallet->GetSolvingProvider(scriptPubKey);
|
||||
if (provider) {
|
||||
if (scriptPubKey.IsPayToScriptHash()) {
|
||||
const CScriptID& hash = CScriptID(boost::get<ScriptHash>(address));
|
||||
@@ -3002,7 +3002,7 @@ static UniValue listunspent(const JSONRPCRequest& request)
|
||||
entry.pushKV("spendable", out.fSpendable);
|
||||
entry.pushKV("solvable", out.fSolvable);
|
||||
if (out.fSolvable) {
|
||||
std::unique_ptr<SigningProvider> provider = pwallet->GetSigningProvider(scriptPubKey);
|
||||
std::unique_ptr<SigningProvider> provider = pwallet->GetSolvingProvider(scriptPubKey);
|
||||
if (provider) {
|
||||
auto descriptor = InferDescriptor(scriptPubKey, *provider);
|
||||
entry.pushKV("desc", descriptor->ToString());
|
||||
@@ -3716,7 +3716,7 @@ static UniValue DescribeWalletAddress(const CWallet* const pwallet, const CTxDes
|
||||
CScript script = GetScriptForDestination(dest);
|
||||
std::unique_ptr<SigningProvider> provider = nullptr;
|
||||
if (pwallet) {
|
||||
provider = pwallet->GetSigningProvider(script);
|
||||
provider = pwallet->GetSolvingProvider(script);
|
||||
}
|
||||
ret.pushKVs(detail);
|
||||
ret.pushKVs(boost::apply_visitor(DescribeWalletAddressVisitor(provider.get()), dest));
|
||||
@@ -3818,7 +3818,7 @@ UniValue getaddressinfo(const JSONRPCRequest& request)
|
||||
CScript scriptPubKey = GetScriptForDestination(dest);
|
||||
ret.pushKV("scriptPubKey", HexStr(scriptPubKey.begin(), scriptPubKey.end()));
|
||||
|
||||
std::unique_ptr<SigningProvider> provider = pwallet->GetSigningProvider(scriptPubKey);
|
||||
std::unique_ptr<SigningProvider> provider = pwallet->GetSolvingProvider(scriptPubKey);
|
||||
|
||||
isminetype mine = pwallet->IsMine(dest);
|
||||
ret.pushKV("ismine", bool(mine & ISMINE_SPENDABLE));
|
||||
|
||||
Reference in New Issue
Block a user