Changeset View
Changeset View
Standalone View
Standalone View
src/outputtype.cpp
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | std::vector<CTxDestination> GetAllDestinationsForKey(const CPubKey &key) { | ||||
return Vector(std::move(p2pkh)); | return Vector(std::move(p2pkh)); | ||||
} | } | ||||
CTxDestination AddAndGetDestinationForScript(FillableSigningProvider &keystore, | CTxDestination AddAndGetDestinationForScript(FillableSigningProvider &keystore, | ||||
const CScript &script, | const CScript &script, | ||||
OutputType type) { | OutputType type) { | ||||
// Add script to keystore | // Add script to keystore | ||||
keystore.AddCScript(script); | keystore.AddCScript(script); | ||||
ScriptHash sh(script); | |||||
// Note that scripts over 520 bytes are not yet supported. | // Note that scripts over 520 bytes are not yet supported. | ||||
switch (type) { | switch (type) { | ||||
case OutputType::LEGACY: | case OutputType::LEGACY: | ||||
return ScriptHash(script); | keystore.AddCScript(GetScriptForDestination(sh)); | ||||
return sh; | |||||
default: | default: | ||||
assert(false); | assert(false); | ||||
} | } | ||||
} | } |