From 5cbb014fe4ee5cb857201dae5191d8dbbdb19adb Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Wed, 12 Dec 2018 11:44:04 +0100 Subject: [PATCH] Validation of pegin inputs --- src/bench/mempool_eviction.cpp | 4 +- src/consensus/tx_verify.cpp | 68 +++++++++---- src/consensus/tx_verify.h | 5 +- src/consensus/validation.h | 2 + src/policy/policy.cpp | 2 +- src/test/mempool_tests.cpp | 94 +++++++++++++++++- src/test/policyestimator_tests.cpp | 11 ++- src/test/test_bitcoin.cpp | 10 +- src/test/test_bitcoin.h | 8 +- src/txdb.cpp | 9 ++ src/txdb.h | 3 + src/txmempool.cpp | 73 ++++++++++++-- src/txmempool.h | 9 +- src/validation.cpp | 147 +++++++++++++++++++++-------- src/wallet/wallet.cpp | 3 +- 15 files changed, 369 insertions(+), 79 deletions(-) diff --git a/src/bench/mempool_eviction.cpp b/src/bench/mempool_eviction.cpp index 0ec7c158cc..6ad5b57ae4 100644 --- a/src/bench/mempool_eviction.cpp +++ b/src/bench/mempool_eviction.cpp @@ -16,9 +16,11 @@ static void AddTx(const CTransactionRef& tx, const CAmount& nFee, CTxMemPool& po bool spendsCoinbase = false; unsigned int sigOpCost = 4; LockPoints lp; + std::set> setPeginsSpent; pool.addUnchecked(tx->GetHash(), CTxMemPoolEntry( tx, nFee, nTime, nHeight, - spendsCoinbase, sigOpCost, lp)); + spendsCoinbase, sigOpCost, lp, + setPeginsSpent)); } // Right now this is only testing eviction performance in an extremely small diff --git a/src/consensus/tx_verify.cpp b/src/consensus/tx_verify.cpp index fb07f472a0..5bdd2cf69f 100644 --- a/src/consensus/tx_verify.cpp +++ b/src/consensus/tx_verify.cpp @@ -8,6 +8,7 @@ #include #include