Skip to content

Commit f4f8f14

Browse files
committed
Add TestMemPoolEntryHelper::FromTx version for CTransaction
1 parent 85ad31e commit f4f8f14

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/test/test_bitcoin.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,11 @@ TestChain100Setup::~TestChain100Setup()
126126

127127
CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(CMutableTransaction &tx, CTxMemPool *pool) {
128128
CTransaction txn(tx);
129-
bool hasNoDependencies = pool ? pool->HasNoInputsOf(tx) : hadNoDependencies;
129+
return FromTx(txn, pool);
130+
}
131+
132+
CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(CTransaction &txn, CTxMemPool *pool) {
133+
bool hasNoDependencies = pool ? pool->HasNoInputsOf(txn) : hadNoDependencies;
130134
// Hack to assume either its completely dependent on other mempool txs or not at all
131135
CAmount inChainValue = hasNoDependencies ? txn.GetValueOut() : 0;
132136

src/test/test_bitcoin.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ struct TestMemPoolEntryHelper
7878
hadNoDependencies(false), spendsCoinbase(false), sigOpCount(1) { }
7979

8080
CTxMemPoolEntry FromTx(CMutableTransaction &tx, CTxMemPool *pool = NULL);
81+
CTxMemPoolEntry FromTx(CTransaction &tx, CTxMemPool *pool = NULL);
8182

8283
// Change the default value
8384
TestMemPoolEntryHelper &Fee(CAmount _fee) { nFee = _fee; return *this; }

0 commit comments

Comments
 (0)