mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-26 12:24:40 +02:00
Refactor: Remove confusing static_cast
This commit is contained in:
parent
faeea1ab58
commit
fadf671fa5
@ -18,27 +18,27 @@
|
||||
typedef std::vector<unsigned char> valtype;
|
||||
|
||||
ScriptHash::ScriptHash(const CScript& in) : BaseHash(Hash160(in)) {}
|
||||
ScriptHash::ScriptHash(const CScriptID& in) : BaseHash(static_cast<uint160>(in)) {}
|
||||
ScriptHash::ScriptHash(const CScriptID& in) : BaseHash{in} {}
|
||||
|
||||
PKHash::PKHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {}
|
||||
PKHash::PKHash(const CKeyID& pubkey_id) : BaseHash(pubkey_id) {}
|
||||
|
||||
WitnessV0KeyHash::WitnessV0KeyHash(const CPubKey& pubkey) : BaseHash(pubkey.GetID()) {}
|
||||
WitnessV0KeyHash::WitnessV0KeyHash(const PKHash& pubkey_hash) : BaseHash(static_cast<uint160>(pubkey_hash)) {}
|
||||
WitnessV0KeyHash::WitnessV0KeyHash(const PKHash& pubkey_hash) : BaseHash{pubkey_hash} {}
|
||||
|
||||
CKeyID ToKeyID(const PKHash& key_hash)
|
||||
{
|
||||
return CKeyID{static_cast<uint160>(key_hash)};
|
||||
return CKeyID{uint160{key_hash}};
|
||||
}
|
||||
|
||||
CKeyID ToKeyID(const WitnessV0KeyHash& key_hash)
|
||||
{
|
||||
return CKeyID{static_cast<uint160>(key_hash)};
|
||||
return CKeyID{uint160{key_hash}};
|
||||
}
|
||||
|
||||
CScriptID ToScriptID(const ScriptHash& script_hash)
|
||||
{
|
||||
return CScriptID{static_cast<uint160>(script_hash)};
|
||||
return CScriptID{uint160{script_hash}};
|
||||
}
|
||||
|
||||
WitnessV0ScriptHash::WitnessV0ScriptHash(const CScript& in)
|
||||
|
Loading…
x
Reference in New Issue
Block a user