Make sure to allow SIGHASH_FORKID in a few places

This commit is contained in:
Jonathan "Duke" Leto 2017-12-30 23:38:58 -08:00
parent 44a066194a
commit 3113973c12
4 changed files with 4 additions and 4 deletions

View File

@ -314,6 +314,6 @@ bool DummySignatureCreator::CreateSig(std::vector<unsigned char>& vchSig, const
vchSig[4 + 33] = 0x02; vchSig[4 + 33] = 0x02;
vchSig[5 + 33] = 32; vchSig[5 + 33] = 32;
vchSig[6 + 33] = 0x01; vchSig[6 + 33] = 0x01;
vchSig[6 + 33 + 32] = SIGHASH_ALL; vchSig[6 + 33 + 32] = SIGHASH_ALL | SIGHASH_FORKID;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ extern unsigned nMaxDatacarrierBytes;
* Failing one of these tests may trigger a DoS ban - see CheckInputs() for * Failing one of these tests may trigger a DoS ban - see CheckInputs() for
* details. * details.
*/ */
static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH; static const unsigned int MANDATORY_SCRIPT_VERIFY_FLAGS = SCRIPT_VERIFY_P2SH | SCRIPT_ENABLE_SIGHASH_FORKID;
/** /**
* Standard script verification flags that standard transactions will comply * Standard script verification flags that standard transactions will comply

View File

@ -424,7 +424,7 @@ BOOST_AUTO_TEST_CASE(test_simple_joinsplit_invalidity)
// Empty output script. // Empty output script.
CScript scriptCode; CScript scriptCode;
CTransaction signTx(newTx); CTransaction signTx(newTx);
uint256 dataToBeSigned = SignatureHash(scriptCode, signTx, NOT_AN_INPUT, SIGHASH_ALL); uint256 dataToBeSigned = SignatureHash(scriptCode, signTx, NOT_AN_INPUT, SIGHASH_ALL | SIGHASH_FORKID);
assert(crypto_sign_detached(&newTx.joinSplitSig[0], NULL, assert(crypto_sign_detached(&newTx.joinSplitSig[0], NULL,
dataToBeSigned.begin(), 32, dataToBeSigned.begin(), 32,

View File

@ -2736,7 +2736,7 @@ bool CWallet::CreateTransaction(const vector<CRecipient>& vecSend, CWalletTx& wt
const CScript& scriptPubKey = coin.first->vout[coin.second].scriptPubKey; const CScript& scriptPubKey = coin.first->vout[coin.second].scriptPubKey;
CScript& scriptSigRes = txNew.vin[nIn].scriptSig; CScript& scriptSigRes = txNew.vin[nIn].scriptSig;
if (sign) if (sign)
signSuccess = ProduceSignature(TransactionSignatureCreator(this, &txNewConst, nIn, SIGHASH_ALL), scriptPubKey, scriptSigRes); signSuccess = ProduceSignature(TransactionSignatureCreator(this, &txNewConst, nIn, SIGHASH_ALL | SIGHASH_FORKID), scriptPubKey, scriptSigRes);
else else
signSuccess = ProduceSignature(DummySignatureCreator(this), scriptPubKey, scriptSigRes); signSuccess = ProduceSignature(DummySignatureCreator(this), scriptPubKey, scriptSigRes);