Changeset View
Changeset View
Standalone View
Standalone View
src/base58.cpp
Show First 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | if (data.size() == 20 + script_prefix.size() && | ||||
std::equal(script_prefix.begin(), script_prefix.end(), data.begin())) { | std::equal(script_prefix.begin(), script_prefix.end(), data.begin())) { | ||||
memcpy(hash.begin(), &data[script_prefix.size()], 20); | memcpy(hash.begin(), &data[script_prefix.size()], 20); | ||||
return CScriptID(hash); | return CScriptID(hash); | ||||
} | } | ||||
return CNoDestination(); | return CNoDestination(); | ||||
} | } | ||||
} // namespace | } // namespace | ||||
} // namespace | |||||
void CBitcoinSecret::SetKey(const CKey &vchSecret) { | void CBitcoinSecret::SetKey(const CKey &vchSecret) { | ||||
assert(vchSecret.IsValid()); | assert(vchSecret.IsValid()); | ||||
SetData(Params().Base58Prefix(CChainParams::SECRET_KEY), vchSecret.begin(), | SetData(Params().Base58Prefix(CChainParams::SECRET_KEY), vchSecret.begin(), | ||||
vchSecret.size()); | vchSecret.size()); | ||||
if (vchSecret.IsCompressed()) vchData.push_back(1); | if (vchSecret.IsCompressed()) vchData.push_back(1); | ||||
} | } | ||||
CKey CBitcoinSecret::GetKey() { | CKey CBitcoinSecret::GetKey() { | ||||
Show All 32 Lines |