Skip to content
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

Stop treating importaddress'ed scripts as change #7687

Merged
merged 1 commit into from Jun 20, 2016

Conversation

@sipa
Copy link
Member

commented Mar 14, 2016

Before this, if someone imported a scriptPubKey directly (in hex form) using importaddress, outputs sending to it would be treated as change, as the corresponding CTxDestination was not added to the address book.

Fix this by trying to detect scriptPubKeys that are in fact convertible to a CTxDestination and add them anyway. Add a warning to the RPC help to warn against importing raw non-standard scripts.

Open question: should the RPC fail/warn in some way when this conversion is not possible? Things like listunspent work fine with such outputs, but listtransactions won't.

@sipa

This comment has been minimized.

Copy link
Member Author

commented Mar 14, 2016

In retrospect, I think it would have been better to have a separate importscript RPC, that only takes a hex script as input, for the p2sh=false case input to importaddress, as its behaviour is very different and does not correspond to what would be considered "importing an address".

@laanwj

This comment has been minimized.

Copy link
Member

commented Mar 18, 2016

utACK 2b3947c

Stop treating importaddress'ed scripts as change
Before this, if someone imported a scriptPubKey directly (in hex form) using
importaddress, outputs sending to it would be treated as change, as the
corresponding CTxDestination was not added to the address book.

Fix this by trying to detect scriptPubKeys that are in fact convertible to a
CTxDestination and add them anyway. Add a warning to the RPC help to warn
against importing raw non-standard scripts.

@sipa sipa force-pushed the sipa:fixscriptimport branch from 2b3947c to 595b22e Jun 2, 2016

@sipa

This comment has been minimized.

Copy link
Member Author

commented Jun 2, 2016

Rebased.

@jonasschnelli

This comment has been minimized.

Copy link
Member

commented Jun 2, 2016

utACK 595b22e

@laanwj laanwj merged commit 595b22e into bitcoin:master Jun 20, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
laanwj added a commit that referenced this pull request Jun 20, 2016
Merge #7687: Stop treating importaddress'ed scripts as change
595b22e Stop treating importaddress'ed scripts as change (Pieter Wuille)
codablock added a commit to codablock/dash that referenced this pull request Dec 28, 2017
Merge bitcoin#7687: Stop treating importaddress'ed scripts as change
595b22e Stop treating importaddress'ed scripts as change (Pieter Wuille)
andvgal added a commit to energicryptocurrency/energi that referenced this pull request Jan 6, 2019
Merge bitcoin#7687: Stop treating importaddress'ed scripts as change
595b22e Stop treating importaddress'ed scripts as change (Pieter Wuille)
@LitecoinZ LitecoinZ referenced this pull request Apr 30, 2019
53 of 77 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.