Merge #14678: [wallet] remove redundant KeyOriginInfo access, already done in CreateSig

b81a186056 GetPubKey: make sigdata const (Gregory Sanders)
f7beb95a1f remove redundant KeyOriginInfo access, already done in CreateSig (Gregory Sanders)

Pull request description:

  This redundancy is confusing as it looks like pubkeyhashes are special in some way based on where it's called.

Tree-SHA512: a980b7c774c6d69322945227a2b156489fb1991ebf57fe6f26096d5f8047f246a133debc241b05af67810f604b040079add3ab3d30d9e2928095905a2afe17eb
This commit is contained in:
Wladimir J. van der Laan 2018-11-23 10:12:55 +01:00
commit 0595164dba
No known key found for this signature in database
GPG key ID: 1E4AED62986CD25D

View file

@ -48,7 +48,7 @@ static bool GetCScript(const SigningProvider& provider, const SignatureData& sig
return false; return false;
} }
static bool GetPubKey(const SigningProvider& provider, SignatureData& sigdata, const CKeyID& address, CPubKey& pubkey) static bool GetPubKey(const SigningProvider& provider, const SignatureData& sigdata, const CKeyID& address, CPubKey& pubkey)
{ {
// Look for pubkey in all partial sigs // Look for pubkey in all partial sigs
const auto it = sigdata.signatures.find(address); const auto it = sigdata.signatures.find(address);
@ -63,14 +63,7 @@ static bool GetPubKey(const SigningProvider& provider, SignatureData& sigdata, c
return true; return true;
} }
// Query the underlying provider // Query the underlying provider
if (provider.GetPubKey(address, pubkey)) { return provider.GetPubKey(address, pubkey);
KeyOriginInfo info;
if (provider.GetKeyOrigin(address, info)) {
sigdata.misc_pubkeys.emplace(address, std::make_pair(pubkey, std::move(info)));
}
return true;
}
return false;
} }
static bool CreateSig(const BaseSignatureCreator& creator, SignatureData& sigdata, const SigningProvider& provider, std::vector<unsigned char>& sig_out, const CPubKey& pubkey, const CScript& scriptcode, SigVersion sigversion) static bool CreateSig(const BaseSignatureCreator& creator, SignatureData& sigdata, const SigningProvider& provider, std::vector<unsigned char>& sig_out, const CPubKey& pubkey, const CScript& scriptcode, SigVersion sigversion)