aboutsummaryrefslogtreecommitdiff
path: root/src/script/sign.cpp
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-10-04 13:53:40 +0200
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2023-10-12 11:27:19 +0200
commitfa05a726c225dc65dee79367bb67f099ae4f99e6 (patch)
tree8bf1f8a82fcf024fe110ac76f9563acf2b1132cf /src/script/sign.cpp
parent4a5aae9330780c3740e27cc511f7cba1fab745b9 (diff)
tidy: modernize-use-emplace
Diffstat (limited to 'src/script/sign.cpp')
-rw-r--r--src/script/sign.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/script/sign.cpp b/src/script/sign.cpp
index 248ad780c3..251a8420f7 100644
--- a/src/script/sign.cpp
+++ b/src/script/sign.cpp
@@ -433,7 +433,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
case TxoutType::SCRIPTHASH: {
uint160 h160{vSolutions[0]};
if (GetCScript(provider, sigdata, CScriptID{h160}, scriptRet)) {
- ret.push_back(std::vector<unsigned char>(scriptRet.begin(), scriptRet.end()));
+ ret.emplace_back(scriptRet.begin(), scriptRet.end());
return true;
}
// Could not find redeemScript, add to missing
@@ -442,7 +442,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
}
case TxoutType::MULTISIG: {
size_t required = vSolutions.front()[0];
- ret.push_back(valtype()); // workaround CHECKMULTISIG bug
+ ret.emplace_back(); // workaround CHECKMULTISIG bug
for (size_t i = 1; i < vSolutions.size() - 1; ++i) {
CPubKey pubkey = CPubKey(vSolutions[i]);
// We need to always call CreateSig in order to fill sigdata with all
@@ -456,7 +456,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
}
bool ok = ret.size() == required + 1;
for (size_t i = 0; i + ret.size() < required + 1; ++i) {
- ret.push_back(valtype());
+ ret.emplace_back();
}
return ok;
}
@@ -466,7 +466,7 @@ static bool SignStep(const SigningProvider& provider, const BaseSignatureCreator
case TxoutType::WITNESS_V0_SCRIPTHASH:
if (GetCScript(provider, sigdata, CScriptID{RIPEMD160(vSolutions[0])}, scriptRet)) {
- ret.push_back(std::vector<unsigned char>(scriptRet.begin(), scriptRet.end()));
+ ret.emplace_back(scriptRet.begin(), scriptRet.end());
return true;
}
// Could not find witnessScript, add to missing
@@ -544,7 +544,7 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato
const auto ms = miniscript::FromScript(witnessscript, ms_satisfier);
solved = ms && ms->Satisfy(ms_satisfier, result) == miniscript::Availability::YES;
}
- result.push_back(std::vector<unsigned char>(witnessscript.begin(), witnessscript.end()));
+ result.emplace_back(witnessscript.begin(), witnessscript.end());
sigdata.scriptWitness.stack = result;
sigdata.witness = true;
@@ -561,7 +561,7 @@ bool ProduceSignature(const SigningProvider& provider, const BaseSignatureCreato
if (!sigdata.witness) sigdata.scriptWitness.stack.clear();
if (P2SH) {
- result.push_back(std::vector<unsigned char>(subscript.begin(), subscript.end()));
+ result.emplace_back(subscript.begin(), subscript.end());
}
sigdata.scriptSig = PushAll(result);