diff --git a/src/outputtype.cpp b/src/outputtype.cpp --- a/src/outputtype.cpp +++ b/src/outputtype.cpp @@ -53,12 +53,10 @@ OutputType type) { // Add script to keystore keystore.AddCScript(script); - ScriptHash sh(script); // Note that scripts over 520 bytes are not yet supported. switch (type) { case OutputType::LEGACY: - keystore.AddCScript(GetScriptForDestination(sh)); - return sh; + return ScriptHash(script); default: assert(false); } diff --git a/src/script/signingprovider.h b/src/script/signingprovider.h --- a/src/script/signingprovider.h +++ b/src/script/signingprovider.h @@ -78,7 +78,53 @@ using KeyMap = std::map; using ScriptMap = std::map; + /** + * Map of key id to unencrypted private keys known by the signing provider. + * Map may be empty if the provider has another source of keys, like an + * encrypted store. + */ KeyMap mapKeys GUARDED_BY(cs_KeyStore); + + /** + * Map of script id to scripts known by the signing provider. + * + * This map originally just held P2SH redeemScripts, and was used by wallet + * code to look up script ids referenced in "OP_HASH160