Skip to content

Commit d243418

Browse files
glozowvijaydasmp
authored andcommitted
Merge bitcoin#28059: refactor: Make more transaction size variables signed
92de74e refactor: Make more transaction size variables signed (Hennadii Stepanov) Pull request description: This PR is a continuation of bitcoin#23962 and it: - gets rid of two static casts, - addresses bitcoin#23962 (comment), - is useful for bitcoin#25972, see the failed ARM and multiprocess CI jobs. ACKs for top commit: MarcoFalke: lgtm ACK 92de74e 🥔 glozow: ACK 92de74e Tree-SHA512: 84225961af8e08439664e75661b98fe86560217e891e5633a28316bf248d88df317a0c6b5a5f6b03feb2b0e0fd40a1f91dd4a85a0610d567470805bf47a84487
1 parent dc3ee4b commit d243418

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/txmempool.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void CTxMemPool::UpdateTransactionsFromBlock(const std::vector<uint256> &vHashes
191191
}
192192
}
193193

194-
bool CTxMemPool::CalculateAncestorsAndCheckLimits(size_t entry_size,
194+
bool CTxMemPool::CalculateAncestorsAndCheckLimits(int64_t entry_size,
195195
size_t entry_count,
196196
setEntries& setAncestors,
197197
CTxMemPoolEntry::Parents& staged_ancestors,
@@ -201,7 +201,7 @@ bool CTxMemPool::CalculateAncestorsAndCheckLimits(size_t entry_size,
201201
uint64_t limitDescendantSize,
202202
std::string &errString) const
203203
{
204-
size_t totalSizeWithAncestors = entry_size;
204+
int64_t totalSizeWithAncestors = entry_size;
205205

206206
while (!staged_ancestors.empty()) {
207207
const CTxMemPoolEntry& stage = staged_ancestors.begin()->get();
@@ -248,7 +248,7 @@ bool CTxMemPool::CheckPackageLimits(const Package& package,
248248
std::string &errString) const
249249
{
250250
CTxMemPoolEntry::Parents staged_ancestors;
251-
size_t total_size = 0;
251+
int64_t total_size = 0;
252252
for (const auto& tx : package) {
253253
total_size += GetVirtualTransactionSize(*tx);
254254
for (const auto& input : tx->vin) {

src/txmempool.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ class CTxMemPool
553553
* param@[in] staged_ancestors Should contain entries in the mempool.
554554
* param@[out] setAncestors Will be populated with all mempool ancestors.
555555
*/
556-
bool CalculateAncestorsAndCheckLimits(size_t entry_size,
556+
bool CalculateAncestorsAndCheckLimits(int64_t entry_size,
557557
size_t entry_count,
558558
setEntries& setAncestors,
559559
CTxMemPoolEntry::Parents &staged_ancestors,

0 commit comments

Comments
 (0)