Browse Source

Merge pull request #5210

1f84793 Avoid a bunch of copying/conversion in script/sign (Pieter Wuille)
0.10
Pieter Wuille 10 years ago
parent
commit
7b7c866160
No known key found for this signature in database
GPG Key ID: 57896D2FF8F0B657
  1. 8
      src/script/sign.cpp
  2. 2
      src/script/sign.h

8
src/script/sign.cpp

@ -144,9 +144,9 @@ static CScript PushAll(const vector<valtype>& values)
return result; return result;
} }
static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction& txTo, unsigned int nIn, static CScript CombineMultisig(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
const vector<valtype>& vSolutions, const vector<valtype>& vSolutions,
vector<valtype>& sigs1, vector<valtype>& sigs2) const vector<valtype>& sigs1, const vector<valtype>& sigs2)
{ {
// Combine all the signatures we've got: // Combine all the signatures we've got:
set<valtype> allsigs; set<valtype> allsigs;
@ -199,7 +199,7 @@ static CScript CombineMultisig(CScript scriptPubKey, const CMutableTransaction&
return result; return result;
} }
static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, static CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
const txnouttype txType, const vector<valtype>& vSolutions, const txnouttype txType, const vector<valtype>& vSolutions,
vector<valtype>& sigs1, vector<valtype>& sigs2) vector<valtype>& sigs1, vector<valtype>& sigs2)
{ {
@ -244,7 +244,7 @@ static CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo,
return CScript(); return CScript();
} }
CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
const CScript& scriptSig1, const CScript& scriptSig2) const CScript& scriptSig1, const CScript& scriptSig2)
{ {
txnouttype txType; txnouttype txType;

2
src/script/sign.h

@ -19,6 +19,6 @@ bool SignSignature(const CKeyStore& keystore, const CTransaction& txFrom, CMutab
// Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders, // Given two sets of signatures for scriptPubKey, possibly with OP_0 placeholders,
// combine them intelligently and return the result. // combine them intelligently and return the result.
CScript CombineSignatures(CScript scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2); CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn, const CScript& scriptSig1, const CScript& scriptSig2);
#endif // BITCOIN_SCRIPT_SIGN_H #endif // BITCOIN_SCRIPT_SIGN_H

Loading…
Cancel
Save