-
Notifications
You must be signed in to change notification settings - Fork 20
hub/sweep_service: optimize bundle #185
base: master
Are you sure you want to change the base?
hub/sweep_service: optimize bundle #185
Conversation
std::vector<db::TransferInput> minimalVecOfInputs; | ||
getVecOfMinSizeWithSumNotLessThan(missing, hubInputs, | ||
minimalVecOfInputs); | ||
hubInputs.swap(minimalVecOfInputs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also need to amend hubInputTotal
as this could vary (required for remainder
calculation)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still missing the change here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hubInputTotal
needs to be adjusted with the sum of minimalVecOfInputs.balance
.
This is relevant for the remainder
on l310
3ff0d1e
to
60cd46a
Compare
/// @param[in] olderThan - the cutoff point in time | ||
/// @return std::vector - a list of TransferInput | ||
virtual std::vector<TransferInput> getHubInputsForSweep( | ||
uint64_t requiredAmount, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also rename the method to availableHubInputs
or similar?
std::vector<db::TransferInput> minimalVecOfInputs; | ||
getVecOfMinSizeWithSumNotLessThan(missing, hubInputs, | ||
minimalVecOfInputs); | ||
hubInputs.swap(minimalVecOfInputs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still missing the change here
…from db query as it is not necessary
…t address as a change address\nso it will be more likely to be picked the next time, (avoid fragmentation)
fdd5106
to
3453aeb
Compare
…t address as a change address\nso it will be more likely to be picked the next time, (avoid fragmentation)
Description
Add new function+call in sweep service to compose a bundle from the minimum number of inputs possible so we don't get a huge bundle
Type of change
How Has This Been Tested?
Checklist:
Please delete items that are not relevant.