Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Do not allow users to get keys from keypool without reserving them #10784
Conversation
|
This could be particularly nasty in some use-cases (especially pre-HD-split) - eg a user might fundrawtransaction, then call getnewaddress, hand out the address for someone to pay them, then sendrawtransaction. This may result in the user thinking they have been paid by their counterparty, even though it was really just their change! This could obviously also result in needless keyreuse. |
laanwj
added Wallet RPC/REST/ZMQ
labels
Jul 11, 2017
|
History of fundrawtransaction regarding change-output: This PR would basically remove the option to not reserve the key. I think in general we should do that, though I'm not sure if there are any API consumers who expect that one can avoid reserving the CO-key. But indeed, that should stop. Concept ACK 6715e78. |
MeshCollider
commented
Jul 11, 2017
|
Concept ACK, seems extremely sensible |
laanwj
added this to the
0.15.0
milestone
Jul 11, 2017
| - assert(changeaddress != "") | ||
| - nextaddr = self.nodes[3].getnewaddress() | ||
| - # Now the change address key should be removed from the keypool | ||
| - assert(changeaddress != nextaddr) |
morcos
Jul 12, 2017
Contributor
You should keep the bottom half of this test to show we're not getting address reuse
|
Alex was here |
fanquake
deleted a comment
from MIGUELWAXX
Jul 12, 2017
|
Pieter was here. |
|
Jonas was here (though wants rebase). |
|
Rebased. |
laanwj
merged commit cf82a9e
into
bitcoin:master
Jul 18, 2017
1 check was pending
laanwj
added a commit
that referenced
this pull request
Jul 18, 2017
|
|
laanwj |
9e8d6a3
|
TheBlueMatt commentedJul 10, 2017
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.