Skip to content

Conversation

@jonasschnelli
Copy link
Contributor

Alternative solution for #9370, fixes #9362.

This adds reserveChangeKey, a new boolean option to fundrawtransaction.
The default is true resulting in always removing the change output address key from the keypool.

Includes test and documentation in the release-notes.

@laanwj
Copy link
Member

laanwj commented Dec 19, 2016

Thanks! Concept ACK.
We could still use #9370 in some form after this, but this is a more effective solution to the issue.

@gmaxwell
Copy link
Contributor

Concept ACK. Thanks!

@laanwj laanwj added this to the 0.14.0 milestone Jan 12, 2017
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why += instead of a regular assignment? What if there's more outputs than one with value > 1?

@jtimon
Copy link
Contributor

jtimon commented Jan 13, 2017

utACK 161af5b modulo the tests which I'm not sure I'm fully understanding. Needs rebase.

@TheBlueMatt
Copy link
Contributor

Needs rebase (but is a bugfix, so can go in for 0.14 after the feature freeze on Monday).

@jonasschnelli
Copy link
Contributor Author

Rebased.

@maflcko
Copy link
Member

maflcko commented Jan 19, 2017 via email

@laanwj
Copy link
Member

laanwj commented Jan 20, 2017

Not going to block this on a test nit - that can be fixed later.
I have enough confidence in this to sneak this in before the feature freeze.

@laanwj laanwj merged commit c9f3062 into bitcoin:master Jan 20, 2017
laanwj added a commit that referenced this pull request Jan 20, 2017
…make it optional

c9f3062 Add fundrawtransactions new reserveChangeKey option to the release notes (Jonas Schnelli)
9eb325d [QA] Add test for fundrawtransactions new reserveChangeKey option (Jonas Schnelli)
9aa4e6a [Wallet] Add an option to keep the change address key, true by default (Jonas Schnelli)
@gituser
Copy link

gituser commented Feb 2, 2017

Just a quick question to confirm: so in the latest master there is no more problem at fundrawtransaction() with address reuse?

We hit an issue when sending transaction via fundrawtransaction change was sent to the existing user account address and thus credited our user with balance.

sendtoaddress always creates a new change address I suppose.

@jonasschnelli
Copy link
Contributor Author

We hit an issue when sending transaction via fundrawtransaction change was sent to the existing user account address and thus credited our user with balance.

Yes. This is exactly what this PR does fix.

laanwj added a commit that referenced this pull request Jul 18, 2017
…erving them

cf82a9e Do not allow users to get keys from keypool without reserving them (Matt Corallo)

Pull request description:

  fundrawtransaction allows users to add a change output and then
  not have it removed from keypool. While it would be nice to have
  users follow the normal CreateTransaction/CommitTransaction process
  we use internally, there isnt much benefit in exposing this option,
  especially with HD wallets, while there is ample room for users to
  misunderstand or misuse this option.

  This partially reverts #9377. Would be nice to get this for 15 since its kinda crazy we have this option to begin with IMO, will need release notes as an RPC option is now ignored.

Tree-SHA512: 72b5ee9c4a229b84d799dfb00c56fe80d8bba914ce81a433c3f5ab325bf9bf2b839ee658c261734f0ee183ab19435039481014d09c41dbe155e6323e63beb01d
codablock pushed a commit to codablock/dash that referenced this pull request Jan 21, 2018
…fault, make it optional

c9f3062 Add fundrawtransactions new reserveChangeKey option to the release notes (Jonas Schnelli)
9eb325d [QA] Add test for fundrawtransactions new reserveChangeKey option (Jonas Schnelli)
9aa4e6a [Wallet] Add an option to keep the change address key, true by default (Jonas Schnelli)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
…fault, make it optional

c9f3062 Add fundrawtransactions new reserveChangeKey option to the release notes (Jonas Schnelli)
9eb325d [QA] Add test for fundrawtransactions new reserveChangeKey option (Jonas Schnelli)
9aa4e6a [Wallet] Add an option to keep the change address key, true by default (Jonas Schnelli)
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 27, 2019
…fault, make it optional

c9f3062 Add fundrawtransactions new reserveChangeKey option to the release notes (Jonas Schnelli)
9eb325d [QA] Add test for fundrawtransactions new reserveChangeKey option (Jonas Schnelli)
9aa4e6a [Wallet] Add an option to keep the change address key, true by default (Jonas Schnelli)
PastaPastaPasta pushed a commit to PastaPastaPasta/dash that referenced this pull request Sep 8, 2019
…out reserving them

cf82a9e Do not allow users to get keys from keypool without reserving them (Matt Corallo)

Pull request description:

  fundrawtransaction allows users to add a change output and then
  not have it removed from keypool. While it would be nice to have
  users follow the normal CreateTransaction/CommitTransaction process
  we use internally, there isnt much benefit in exposing this option,
  especially with HD wallets, while there is ample room for users to
  misunderstand or misuse this option.

  This partially reverts bitcoin#9377. Would be nice to get this for 15 since its kinda crazy we have this option to begin with IMO, will need release notes as an RPC option is now ignored.

Tree-SHA512: 72b5ee9c4a229b84d799dfb00c56fe80d8bba914ce81a433c3f5ab325bf9bf2b839ee658c261734f0ee183ab19435039481014d09c41dbe155e6323e63beb01d
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fundrawtransaction doesn't keep change address pool key

7 participants