diff options
| author | Alex Morcos <[email protected]> | 2015-11-13 10:05:21 -0500 |
|---|---|---|
| committer | Alex Morcos <[email protected]> | 2015-11-19 21:44:35 -0500 |
| commit | c0353064ddf71ad103bd19f6e7c10ff8e240ac46 (patch) | |
| tree | 9fec6d8c6ddb79925d90b2d12582e2dee3380de6 /src/test/test_bitcoin.cpp | |
| parent | Modify variable names for entry height and priority (diff) | |
| download | discoin-c0353064ddf71ad103bd19f6e7c10ff8e240ac46.tar.xz discoin-c0353064ddf71ad103bd19f6e7c10ff8e240ac46.zip | |
Change GetPriority calculation.
Compute the value of inputs that already are in the chain at time of mempool entry and only increase priority due to aging for those inputs. This effectively changes the CTxMemPoolEntry's GetPriority calculation from an upper bound to a lower bound.
Diffstat (limited to 'src/test/test_bitcoin.cpp')
| -rw-r--r-- | src/test/test_bitcoin.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp index 2fe190f88..351870014 100644 --- a/src/test/test_bitcoin.cpp +++ b/src/test/test_bitcoin.cpp @@ -144,8 +144,13 @@ TestChain100Setup::~TestChain100Setup() CTxMemPoolEntry TestMemPoolEntryHelper::FromTx(CMutableTransaction &tx, CTxMemPool *pool) { - return CTxMemPoolEntry(tx, nFee, nTime, dPriority, nHeight, - pool ? pool->HasNoInputsOf(tx) : hadNoDependencies); + CTransaction txn(tx); + bool hasNoDependencies = pool ? pool->HasNoInputsOf(tx) : hadNoDependencies; + // Hack to assume either its completely dependent on other mempool txs or not at all + CAmount inChainValue = hasNoDependencies ? txn.GetValueOut() : 0; + + return CTxMemPoolEntry(txn, nFee, nTime, dPriority, nHeight, + hasNoDependencies, inChainValue); } void Shutdown(void* parg) |