-
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
commands: increment address index if current value used for new spend #963
commands: increment address index if current value used for new spend #963
Conversation
@@ -261,7 +261,7 @@ impl DaemonControl { | |||
addr_info: &Option<AddrInfo>, | |||
) { | |||
if let Some(AddrInfo { index, is_change }) = addr_info { | |||
if *is_change && db_conn.change_index() < *index { | |||
if *is_change && db_conn.change_index() <= *index { |
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.
Should also fix the check against receive index right below?
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.
Ah yes, I'll take a look.
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 now made this fix for the receive index and updated the functional tests.
I didn't test for this in the rust tests as derivation_index_by_address
returns None
in the dummy DB and so we don't enter the affected function in relation to receive addresses (we do enter the affected function for change addresses that have been generated within create_spend
).
d562c4e
to
323470d
Compare
Rebased on master. |
ACK 323470d -- great catch, thanks. |
323470d
to
3a12ea0
Compare
Rebased on master. |
re-ACK bfd6ca5 |
This is a fix to ensure the change index in the database is incremented if a new spend is created with a change address derived from the current index, regardless of whether this new spend is broadcast or not.
This is a similar fix as for the change index.
3a12ea0
to
bfd6ca5
Compare
This is a fix to ensure the change index in the database is incremented if a new spend is created with a change address derived from the current index, regardless of whether this new spend is broadcast or not.
EDIT: The same fix has been applied to the receive index.