@@ -155,12 +155,12 @@ void CTxMemPool::UpdateTransactionsFromBlock(const std::vector<uint256>& vHashes
155155}
156156
157157util::Result<CTxMemPool::setEntries> CTxMemPool::CalculateAncestorsAndCheckLimits (
158- size_t entry_size,
158+ int64_t entry_size,
159159 size_t entry_count,
160160 CTxMemPoolEntry::Parents& staged_ancestors,
161161 const Limits& limits) const
162162{
163- size_t totalSizeWithAncestors = entry_size;
163+ int64_t totalSizeWithAncestors = entry_size;
164164 setEntries ancestors;
165165
166166 while (!staged_ancestors.empty ()) {
@@ -171,11 +171,11 @@ util::Result<CTxMemPool::setEntries> CTxMemPool::CalculateAncestorsAndCheckLimit
171171 staged_ancestors.erase (stage);
172172 totalSizeWithAncestors += stageit->GetTxSize ();
173173
174- if (stageit->GetSizeWithDescendants () + entry_size > static_cast < uint64_t >( limits.descendant_size_vbytes ) ) {
174+ if (stageit->GetSizeWithDescendants () + entry_size > limits.descendant_size_vbytes ) {
175175 return util::Error{Untranslated (strprintf (" exceeds descendant size limit for tx %s [limit: %u]" , stageit->GetTx ().GetHash ().ToString (), limits.descendant_size_vbytes ))};
176176 } else if (stageit->GetCountWithDescendants () + entry_count > static_cast <uint64_t >(limits.descendant_count )) {
177177 return util::Error{Untranslated (strprintf (" too many descendants for tx %s [limit: %u]" , stageit->GetTx ().GetHash ().ToString (), limits.descendant_count ))};
178- } else if (totalSizeWithAncestors > static_cast < uint64_t >( limits.ancestor_size_vbytes ) ) {
178+ } else if (totalSizeWithAncestors > limits.ancestor_size_vbytes ) {
179179 return util::Error{Untranslated (strprintf (" exceeds ancestor size limit [limit: %u]" , limits.ancestor_size_vbytes ))};
180180 }
181181
@@ -201,7 +201,7 @@ bool CTxMemPool::CheckPackageLimits(const Package& package,
201201 std::string &errString) const
202202{
203203 CTxMemPoolEntry::Parents staged_ancestors;
204- size_t total_size = 0 ;
204+ int64_t total_size = 0 ;
205205 for (const auto & tx : package) {
206206 total_size += GetVirtualTransactionSize (*tx);
207207 for (const auto & input : tx->vin ) {
0 commit comments