aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
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/rpc
parent4a5aae9330780c3740e27cc511f7cba1fab745b9 (diff)
tidy: modernize-use-emplace
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/blockchain.cpp2
-rw-r--r--src/rpc/rawtransaction.cpp8
-rw-r--r--src/rpc/server.cpp2
3 files changed, 6 insertions, 6 deletions
diff --git a/src/rpc/blockchain.cpp b/src/rpc/blockchain.cpp
index 31dd8164fe..ab710d868a 100644
--- a/src/rpc/blockchain.cpp
+++ b/src/rpc/blockchain.cpp
@@ -1930,7 +1930,7 @@ static RPCHelpMan getblockstats()
// New feerate uses satoshis per virtual byte instead of per serialized byte
CAmount feerate = weight ? (txfee * WITNESS_SCALE_FACTOR) / weight : 0;
if (do_feerate_percentiles) {
- feerate_array.emplace_back(std::make_pair(feerate, weight));
+ feerate_array.emplace_back(feerate, weight);
}
maxfeerate = std::max(maxfeerate, feerate);
minfeerate = std::min(minfeerate, feerate);
diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp
index 31ca126862..16705b3ce2 100644
--- a/src/rpc/rawtransaction.cpp
+++ b/src/rpc/rawtransaction.cpp
@@ -1581,10 +1581,10 @@ static RPCHelpMan createpsbt()
PartiallySignedTransaction psbtx;
psbtx.tx = rawTx;
for (unsigned int i = 0; i < rawTx.vin.size(); ++i) {
- psbtx.inputs.push_back(PSBTInput());
+ psbtx.inputs.emplace_back();
}
for (unsigned int i = 0; i < rawTx.vout.size(); ++i) {
- psbtx.outputs.push_back(PSBTOutput());
+ psbtx.outputs.emplace_back();
}
// Serialize the PSBT
@@ -1648,10 +1648,10 @@ static RPCHelpMan converttopsbt()
PartiallySignedTransaction psbtx;
psbtx.tx = tx;
for (unsigned int i = 0; i < tx.vin.size(); ++i) {
- psbtx.inputs.push_back(PSBTInput());
+ psbtx.inputs.emplace_back();
}
for (unsigned int i = 0; i < tx.vout.size(); ++i) {
- psbtx.outputs.push_back(PSBTOutput());
+ psbtx.outputs.emplace_back();
}
// Serialize the PSBT
diff --git a/src/rpc/server.cpp b/src/rpc/server.cpp
index daf751111f..d3c5a19326 100644
--- a/src/rpc/server.cpp
+++ b/src/rpc/server.cpp
@@ -88,7 +88,7 @@ std::string CRPCTable::help(const std::string& strCommand, const JSONRPCRequest&
vCommands.reserve(mapCommands.size());
for (const auto& entry : mapCommands)
- vCommands.push_back(make_pair(entry.second.front()->category + entry.first, entry.second.front()));
+ vCommands.emplace_back(entry.second.front()->category + entry.first, entry.second.front());
sort(vCommands.begin(), vCommands.end());
JSONRPCRequest jreq = helpreq;