From 19421ceb48e5140aa109eb836ada1f6093ef8ec2 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 25 Apr 2016 17:04:13 -0700 Subject: [PATCH] Add TestMemPoolEntryHelper::FromTx version for CTransaction --- src/test/test_bitcoin.cpp | 6 +++++- src/test/test_bitcoin.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index d6dfd54cb..078d65b77 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -125,7 +125,11 @@ TestChain100Setup::~TestChain100Setup() CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(CMutableTransaction &tx, CTxMemPool *pool) { CTransaction txn(tx); - bool hasNoDependencies = pool ? pool->HasNoInputsOf(tx) : hadNoDependencies; + return FromTx(txn, pool); +} + +CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(CTransaction &txn, CTxMemPool *pool) { + bool hasNoDependencies = pool ? pool->HasNoInputsOf(txn) : hadNoDependencies; // Hack to assume either its completely dependent on other mempool txs or not at all CAmount inChainValue = hasNoDependencies ? txn.GetValueOut() : 0; diff --git a/src/test/test_bitcoin.h b/src/test/test_bitcoin.h index 7ec0af709..7b7f282e4 100644 --- a/src/test/test_bitcoin.h +++ b/src/test/test_bitcoin.h @@ -74,6 +74,7 @@ struct TestMemPoolEntryHelper hadNoDependencies(false), spendsCoinbase(false), sigOpCount(1) { } CTxMemPoolEntry FromTx(CMutableTransaction &tx, CTxMemPool *pool = NULL); + CTxMemPoolEntry FromTx(CTransaction &tx, CTxMemPool *pool = NULL); // Change the default value TestMemPoolEntryHelper &Fee(CAmount _fee) { nFee = _fee; return *this; }