@@ -304,7 +304,7 @@ static void MutateTxAddOutAddr(CMutableTransaction& tx, const std::string& strIn
304
304
CAmount value = ExtractAndValidateValue (vStrInputParts[0 ]);
305
305
306
306
// extract and validate ADDRESS
307
- std::string strAddr = vStrInputParts[1 ];
307
+ const std::string& strAddr = vStrInputParts[1 ];
308
308
CTxDestination destination = DecodeDestination (strAddr);
309
309
if (!IsValidDestination (destination)) {
310
310
throw std::runtime_error (" invalid TX output address" );
@@ -337,7 +337,7 @@ static void MutateTxAddOutPubKey(CMutableTransaction& tx, const std::string& str
337
337
bool bSegWit = false ;
338
338
bool bScriptHash = false ;
339
339
if (vStrInputParts.size () == 3 ) {
340
- std::string flags = vStrInputParts[2 ];
340
+ const std::string& flags = vStrInputParts[2 ];
341
341
bSegWit = (flags.find (' W' ) != std::string::npos);
342
342
bScriptHash = (flags.find (' S' ) != std::string::npos);
343
343
}
@@ -398,7 +398,7 @@ static void MutateTxAddOutMultiSig(CMutableTransaction& tx, const std::string& s
398
398
bool bSegWit = false ;
399
399
bool bScriptHash = false ;
400
400
if (vStrInputParts.size () == numkeys + 4 ) {
401
- std::string flags = vStrInputParts.back ();
401
+ const std::string& flags = vStrInputParts.back ();
402
402
bSegWit = (flags.find (' W' ) != std::string::npos);
403
403
bScriptHash = (flags.find (' S' ) != std::string::npos);
404
404
}
@@ -473,14 +473,14 @@ static void MutateTxAddOutScript(CMutableTransaction& tx, const std::string& str
473
473
CAmount value = ExtractAndValidateValue (vStrInputParts[0 ]);
474
474
475
475
// extract and validate script
476
- std::string strScript = vStrInputParts[1 ];
476
+ const std::string& strScript = vStrInputParts[1 ];
477
477
CScript scriptPubKey = ParseScript (strScript);
478
478
479
479
// Extract FLAGS
480
480
bool bSegWit = false ;
481
481
bool bScriptHash = false ;
482
482
if (vStrInputParts.size () == 3 ) {
483
- std::string flags = vStrInputParts.back ();
483
+ const std::string& flags = vStrInputParts.back ();
484
484
bSegWit = (flags.find (' W' ) != std::string::npos);
485
485
bScriptHash = (flags.find (' S' ) != std::string::npos);
486
486
}
0 commit comments