-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support greedy addressees #106
base: master
Are you sure you want to change the base?
Conversation
src/ga_tx.cpp
Outdated
// No need for implicit change output | ||
continue; | ||
} | ||
|
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.
At 792 we should add the dust to an explicit change output if there is one.
I think we also need a check that if any outputs are marked is_change
then the tx has no added change output already.
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.
I've moved this logic around a bit so that now any dust will be added to the greedy addressee before being considered for change.
Logic should be such that there won't be a change output if there is a greedy one.
5f678ac
to
8d74316
Compare
5b57e2c
to
bf41f83
Compare
fc05354
to
1d97818
Compare
1d97818
to
bae239e
Compare
bae239e
to
26427ca
Compare
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.
Perhaps you want to merge the first cleanup commit, and we can look at the greedy change in isolation after review?
src/ga_tx.cpp
Outdated
for (auto& addressee : *addressees_p) { | ||
const auto addressee_asset_id = asset_id_from_json(net_params, addressee); | ||
if (addressee_asset_id == asset_id) { | ||
required_total += add_tx_addressee(session, net_params, result, tx, addressee); | ||
reordered_addressees.push_back(addressee); | ||
if (addressee.value("greedy", false)) { |
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.
booleans in json should be named is_xxx
, has_xxx
etc.
There is no check here for multiple greedy outputs, should that error?
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.
Changed to is_greedy
26427ca
to
3881e9e
Compare
Setting the 'greedy' flag on an addressee means it will consume any change instead of it going to a change output.
3881e9e
to
d74f723
Compare
Setting the 'greedy' flag on an addressee means it will consume any change instead of it going to a change output.