mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Merge #19852: refactor: Avoid duplicate map lookup in ScriptToAsmStr
ac2ff4fb1e06270cf17727f90599c9f3a55ddd5a refactor: Avoid duplicate map lookup in ScriptToAsmStr (João Barbosa) Pull request description: Simple change that avoids a duplicate (unnecessary) `mapSigHashTypes` lookup. ACKs for top commit: laanwj: re-ACK ac2ff4fb1e06270cf17727f90599c9f3a55ddd5a Tree-SHA512: 7e7f5af51c1acd7a42af273e5ee5e2faddd250ba8b8f63ccb3172d95f153ae391b2816b79564b856571af52dc2a767b5736a5d10ffb5cd2c540cd9832bf86419
This commit is contained in:
parent
a560d32f8c
commit
64c0ce9401
@ -120,8 +120,9 @@ std::string ScriptToAsmStr(const CScript& script, const bool fAttemptSighashDeco
|
||||
// checks in CheckSignatureEncoding.
|
||||
if (CheckSignatureEncoding(vch, SCRIPT_VERIFY_STRICTENC, nullptr)) {
|
||||
const unsigned char chSigHashType = vch.back();
|
||||
if (mapSigHashTypes.count(chSigHashType)) {
|
||||
strSigHashDecode = "[" + mapSigHashTypes.find(chSigHashType)->second + "]";
|
||||
const auto it = mapSigHashTypes.find(chSigHashType);
|
||||
if (it != mapSigHashTypes.end()) {
|
||||
strSigHashDecode = "[" + it->second + "]";
|
||||
vch.pop_back(); // remove the sighash type byte. it will be replaced by the decode.
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user