Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115035
D3185.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
6 KB
Subscribers
None
D3185.diff
View Options
diff --git a/src/test/mempool_tests.cpp b/src/test/mempool_tests.cpp
--- a/src/test/mempool_tests.cpp
+++ b/src/test/mempool_tests.cpp
@@ -43,7 +43,6 @@
Amount totalFee = Amount::zero();
size_t totalSize = CTransaction(parentOfAll).GetTotalSize();
- size_t totalBillableSize = CTransaction(parentOfAll).GetBillableSize();
// Generate 100 transactions
for (size_t totalTransactions = 0; totalTransactions < 100;
@@ -111,7 +110,6 @@
// Calculate overall values
totalFee += randFee;
totalSize += CTransaction(tx).GetTotalSize();
- totalBillableSize += CTransaction(tx).GetBillableSize();
CTxMemPoolEntry parentEntry = *testPool.mapTx.find(parentOfAllId);
CTxMemPoolEntry latestEntry = *testPool.mapTx.find(curId);
@@ -128,8 +126,6 @@
BOOST_CHECK_EQUAL(parentEntry.GetCountWithDescendants(),
testPool.mapTx.size());
BOOST_CHECK_EQUAL(parentEntry.GetSizeWithDescendants(), totalSize);
- BOOST_CHECK_EQUAL(parentEntry.GetBillableSizeWithDescendants(),
- totalBillableSize);
BOOST_CHECK_EQUAL(parentEntry.GetModFeesWithDescendants(), totalFee);
}
}
diff --git a/src/txmempool.h b/src/txmempool.h
--- a/src/txmempool.h
+++ b/src/txmempool.h
@@ -119,7 +119,6 @@
uint64_t nCountWithDescendants;
//!< ... and size
uint64_t nSizeWithDescendants;
- uint64_t nBillableSizeWithDescendants;
//!< ... and total fees (all including us)
Amount nModFeesWithDescendants;
@@ -155,8 +154,8 @@
const LockPoints &GetLockPoints() const { return lockPoints; }
// Adjusts the descendant state, if this entry is not dirty.
- void UpdateDescendantState(int64_t modifySize, int64_t modifyBillableSize,
- Amount modifyFee, int64_t modifyCount);
+ void UpdateDescendantState(int64_t modifySize, Amount modifyFee,
+ int64_t modifyCount);
// Adjusts the ancestor state
void UpdateAncestorState(int64_t modifySize, Amount modifyFee,
int64_t modifyCount, int modifySigOps);
@@ -168,9 +167,6 @@
uint64_t GetCountWithDescendants() const { return nCountWithDescendants; }
uint64_t GetSizeWithDescendants() const { return nSizeWithDescendants; }
- uint64_t GetBillableSizeWithDescendants() const {
- return nBillableSizeWithDescendants;
- }
Amount GetModFeesWithDescendants() const { return nModFeesWithDescendants; }
bool GetSpendsCoinbase() const { return spendsCoinbase; }
@@ -188,19 +184,17 @@
// Helpers for modifying CTxMemPool::mapTx, which is a boost multi_index.
struct update_descendant_state {
- update_descendant_state(int64_t _modifySize, int64_t _modifyBillableSize,
- Amount _modifyFee, int64_t _modifyCount)
- : modifySize(_modifySize), modifyBillableSize(_modifyBillableSize),
- modifyFee(_modifyFee), modifyCount(_modifyCount) {}
+ update_descendant_state(int64_t _modifySize, Amount _modifyFee,
+ int64_t _modifyCount)
+ : modifySize(_modifySize), modifyFee(_modifyFee),
+ modifyCount(_modifyCount) {}
void operator()(CTxMemPoolEntry &e) {
- e.UpdateDescendantState(modifySize, modifyBillableSize, modifyFee,
- modifyCount);
+ e.UpdateDescendantState(modifySize, modifyFee, modifyCount);
}
private:
int64_t modifySize;
- int64_t modifyBillableSize;
Amount modifyFee;
int64_t modifyCount;
};
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -42,7 +42,6 @@
nCountWithDescendants = 1;
nSizeWithDescendants = GetTxSize();
- nBillableSizeWithDescendants = GetTxBillableSize();
nModFeesWithDescendants = nFee;
Amount nValueIn = tx->GetValueOut() + nFee;
assert(inChainInputValue <= nValueIn);
@@ -108,13 +107,11 @@
// setAllDescendants now contains all in-mempool descendants of updateIt.
// Update and add to cached descendant map
int64_t modifySize = 0;
- int64_t modifyBillableSize = 0;
int64_t modifyCount = 0;
Amount modifyFee = Amount::zero();
for (txiter cit : setAllDescendants) {
if (!setExclude.count(cit->GetTx().GetId())) {
modifySize += cit->GetTxSize();
- modifyBillableSize += cit->GetTxBillableSize();
modifyFee += cit->GetModifiedFee();
modifyCount++;
cachedDescendants[updateIt].insert(cit);
@@ -126,8 +123,7 @@
}
}
mapTx.modify(updateIt,
- update_descendant_state(modifySize, modifyBillableSize,
- modifyFee, modifyCount));
+ update_descendant_state(modifySize, modifyFee, modifyCount));
}
// txidsToUpdate is the set of transaction hashes from a disconnected block
@@ -275,12 +271,10 @@
}
const int64_t updateCount = (add ? 1 : -1);
const int64_t updateSize = updateCount * it->GetTxSize();
- const int64_t updateBillableSize = updateCount * it->GetTxBillableSize();
const Amount updateFee = updateCount * it->GetModifiedFee();
for (txiter ancestorIt : setAncestors) {
- mapTx.modify(ancestorIt,
- update_descendant_state(updateSize, updateBillableSize,
- updateFee, updateCount));
+ mapTx.modify(ancestorIt, update_descendant_state(updateSize, updateFee,
+ updateCount));
}
}
@@ -368,13 +362,10 @@
}
void CTxMemPoolEntry::UpdateDescendantState(int64_t modifySize,
- int64_t modifyBillableSize,
Amount modifyFee,
int64_t modifyCount) {
nSizeWithDescendants += modifySize;
assert(int64_t(nSizeWithDescendants) > 0);
- nBillableSizeWithDescendants += modifyBillableSize;
- assert(int64_t(nBillableSizeWithDescendants) >= 0);
nModFeesWithDescendants += modifyFee;
nCountWithDescendants += modifyCount;
assert(int64_t(nCountWithDescendants) > 0);
@@ -971,7 +962,7 @@
nNoLimit, nNoLimit, dummy, false);
for (txiter ancestorIt : setAncestors) {
mapTx.modify(ancestorIt,
- update_descendant_state(0, 0, nFeeDelta, 0));
+ update_descendant_state(0, nFeeDelta, 0));
}
// Now update all descendants' modified fees with ancestors
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 1, 09:23 (10 m, 24 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187192
Default Alt Text
D3185.diff (6 KB)
Attached To
D3185: Do not update billable size in descendents
Event Timeline
Log In to Comment