most unit tests working, down to only 159 failures

This commit is contained in:
Ray Engelking 2018-01-15 17:10:53 -05:00
parent 484143f7d0
commit 8d7ce89b2c
8 changed files with 519 additions and 508 deletions

0
src/miner.cpp Normal file → Executable file
View File

0
src/miner.h Normal file → Executable file
View File

0
src/primitives/transaction.h Normal file → Executable file
View File

View File

@ -120,8 +120,9 @@ UniValue generateBlocks(std::shared_ptr<CReserveScript> coinbaseScript, int nGen
UniValue blockHashes(UniValue::VARR); UniValue blockHashes(UniValue::VARR);
while (nHeight < nHeightEnd) while (nHeight < nHeightEnd)
{ {
std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(Params()).CreateNewBlock(coinbaseScript->reserveScript, true, strTxComment)); // std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(Params()).CreateNewBlock(coinbaseScript->reserveScript, true, strTxComment));
if (!pblocktemplate.get()) std::unique_ptr<CBlockTemplate> pblocktemplate(BlockAssembler(Params()).CreateNewBlock(coinbaseScript->reserveScript, true));
if (!pblocktemplate.get())
throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block"); throw JSONRPCError(RPC_INTERNAL_ERROR, "Couldn't create new block");
CBlock *pblock = &pblocktemplate->block; CBlock *pblock = &pblocktemplate->block;
{ {

7
src/script/interpreter.cpp Normal file → Executable file
View File

@ -1137,6 +1137,9 @@ public:
SerializeOutput(s, nOutput); SerializeOutput(s, nOutput);
// Serialize nLockTime // Serialize nLockTime
::Serialize(s, txTo.nLockTime); ::Serialize(s, txTo.nLockTime);
// Serialize strTxComment
if (txTo.nVersion >= 2)
::Serialize(s, txTo.strTxComment);
} }
}; };
@ -1214,9 +1217,13 @@ uint256 SignatureHash(const CScript& scriptCode, const CTransaction& txTo, unsig
ss << hashOutputs; ss << hashOutputs;
// Locktime // Locktime
ss << txTo.nLockTime; ss << txTo.nLockTime;
// TX Comment
if (txTo.nVersion >= 2)
ss << txTo.strTxComment;
// Sighash type // Sighash type
ss << nHashType; ss << nHashType;
return ss.GetHash(); return ss.GetHash();
} }

1006
src/test/data/sighash.json Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,9 @@
#include <univalue.h> #include <univalue.h>
//uncomment this line to
//#define PRINT_SIGHASH_JSON
extern UniValue read_json(const std::string& jsondata); extern UniValue read_json(const std::string& jsondata);
// Old script.cpp SignatureHash function // Old script.cpp SignatureHash function

View File

@ -1197,9 +1197,9 @@ void UpdateCoins(const CTransaction& tx, CCoinsViewCache& inputs, int nHeight)
} }
bool CScriptCheck::operator()() { bool CScriptCheck::operator()() {
if (chainActive.Height() < 2000000) { // if (chainActive.Height() < 2000000) {
return true; // ToDo: bitspill // return true; // ToDo: bitspill
} // }
const CScript &scriptSig = ptxTo->vin[nIn].scriptSig; const CScript &scriptSig = ptxTo->vin[nIn].scriptSig;
const CScriptWitness *witness = &ptxTo->vin[nIn].scriptWitness; const CScriptWitness *witness = &ptxTo->vin[nIn].scriptWitness;
return VerifyScript(scriptSig, scriptPubKey, witness, nFlags, CachingTransactionSignatureChecker(ptxTo, nIn, amount, cacheStore, *txdata), &error); return VerifyScript(scriptSig, scriptPubKey, witness, nFlags, CachingTransactionSignatureChecker(ptxTo, nIn, amount, cacheStore, *txdata), &error);