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

Projects
None yet
3 participants
@sipa
Member

sipa 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.

Show comment
Hide comment
@sipa

sipa Mar 14, 2016

Member

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".

Member

sipa 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.

Show comment
Hide comment
@laanwj

laanwj Mar 18, 2016

Member

utACK 2b3947c

Member

laanwj 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

This comment has been minimized.

Show comment
Hide comment
@sipa

sipa Jun 2, 2016

Member

Rebased.

Member

sipa commented Jun 2, 2016

Rebased.

@jonasschnelli

This comment has been minimized.

Show comment
Hide comment
@jonasschnelli
Member

jonasschnelli 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 Sep 16, 2017

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 Sep 19, 2017

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 27, 2017

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 #7687: Stop treating importaddress'ed scripts as change
595b22e Stop treating importaddress'ed scripts as change (Pieter Wuille)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment