Make Hash[160] consume range-like objects

This commit is contained in:
Pieter Wuille
2020-06-26 13:36:41 -07:00
parent 02c4cc5c5d
commit 77c507358b
16 changed files with 40 additions and 63 deletions

View File

@@ -630,13 +630,13 @@ static size_t CalculateNestedKeyhashInputSize(bool use_max_sig)
CPubKey pubkey = key.GetPubKey();
// Generate pubkey hash
uint160 key_hash(Hash160(pubkey.begin(), pubkey.end()));
uint160 key_hash(Hash160(pubkey));
// Create inner-script to enter into keystore. Key hash can't be 0...
CScript inner_script = CScript() << OP_0 << std::vector<unsigned char>(key_hash.begin(), key_hash.end());
// Create outer P2SH script for the output
uint160 script_id(Hash160(inner_script.begin(), inner_script.end()));
uint160 script_id(Hash160(inner_script));
CScript script_pubkey = CScript() << OP_HASH160 << std::vector<unsigned char>(script_id.begin(), script_id.end()) << OP_EQUAL;
// Add inner-script to key store and key to watchonly