Fix backporting errors

pos.cpp
primitives/transaction.cpp
rpc/rawtransaction.cpp
script/sign.cpp
script/sign.h
txmempool.cpp
This commit is contained in:
lateminer
2018-10-13 18:55:32 +03:00
parent 00cb4673b2
commit 17401c86d1
6 changed files with 14 additions and 11 deletions

View File

@@ -18,8 +18,7 @@ using namespace std;
typedef std::vector<unsigned char> valtype;
static const CAmount amountZero = 0;
TransactionSignatureCreator::TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, int nHashTypeIn) : BaseSignatureCreator(keystoreIn), txTo(txToIn), nIn(nInIn), nHashType(nHashTypeIn), checker(txTo, nIn, amountZero) {}
TransactionSignatureCreator::TransactionSignatureCreator(const CKeyStore* keystoreIn, const CTransaction* txToIn, unsigned int nInIn, const CAmount& amountIn, int nHashTypeIn) : BaseSignatureCreator(keystoreIn), txTo(txToIn), nIn(nInIn), nHashType(nHashTypeIn), amount(amountIn), checker(txTo, nIn, amountIn) {}
bool TransactionSignatureCreator::CreateSig(std::vector<unsigned char>& vchSig, const CKeyID& address, const CScript& scriptCode) const
{
@@ -27,7 +26,7 @@ bool TransactionSignatureCreator::CreateSig(std::vector<unsigned char>& vchSig,
if (!keystore->GetKey(address, key))
return false;
uint256 hash = SignatureHash(scriptCode, *txTo, nIn, nHashType);
uint256 hash = SignatureHash(scriptCode, *txTo, nIn, nHashType, amount);
if (!key.Sign(hash, vchSig))
return false;
vchSig.push_back((unsigned char)nHashType);
@@ -259,7 +258,7 @@ static CScript CombineSignatures(const CScript& scriptPubKey, const BaseSignatur
CScript CombineSignatures(const CScript& scriptPubKey, const CTransaction& txTo, unsigned int nIn,
const CScript& scriptSig1, const CScript& scriptSig2)
{
TransactionSignatureChecker checker(&txTo, nIn, amountZero);
TransactionSignatureChecker checker(&txTo, nIn, 0);
return CombineSignatures(scriptPubKey, checker, scriptSig1, scriptSig2);
}