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

[RPC][Wallet][Segwit] Bug: Transaction sent to imported P2WSH does not appear in listtransaction. #10924

Closed
NicolasDorier opened this issue Jul 25, 2017 · 7 comments

Comments

@NicolasDorier
Copy link
Contributor

NicolasDorier commented Jul 25, 2017

It seems that there is a bug when a node sends coins to an imported P2WSH.
Such transaction does not appear in listtransaction unlike P2SH.

Note that if node A sends to node B where B imported the P2WSH, things works as expected, and both A and B would see the transaction in listtransaction.

The stangest thing is that gettransaction seems to know about the transaction. (but not the details)

Repro:
https://github.com/NicolasDorier/bitcoin/commits/importaddresssegwit
If you switch use_p2wsh to false, it passes, else, it does not.
Failing on assert(self.nodes[0].listtransactions("*", 1, 0, True)[0]["txid"] == txid)

ping @sipa this is the bug I bumped on TumbleBit that I explained to you.

@maflcko maflcko added this to the 0.15.0 milestone Jul 27, 2017
@maflcko maflcko added the Bug label Jul 27, 2017
@sipa
Copy link
Member

sipa commented Jul 28, 2017

A short update (thanks @NicolasDorier): there is no CTxDestination for native witness outputs, which means any importaddress is unable to mark the importer scriptPubKey as anything but change. This leads to inconsistent gettransaction/listtransactions output.

There are 2 solutions here:

  • make importaddress fail to import addresses with no CTxDestination (or warn at least)
  • Add BIP173 support

@sipa
Copy link
Member

sipa commented Jul 28, 2017

Actually, (1) is already warned about in the importaddress RPC help text.

@NicolasDorier
Copy link
Contributor Author

my attempt to fix the issue, #10947 it would need to have bech32 support though.

@ryanofsky
Copy link
Contributor

Should #10947 be tagged for 0.15, or should this be untagged?

@NicolasDorier
Copy link
Contributor Author

NicolasDorier commented Aug 4, 2017

Should not be tagged for 0.15. I think the best is to wait next version, non obvious code change.

@maflcko maflcko removed this from the 0.15.0 milestone Aug 4, 2017
@maflcko
Copy link
Member

maflcko commented Aug 4, 2017

Cleared milestone 0.15.

@NicolasDorier
Copy link
Contributor Author

Closing as this was solved by #11167

@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.
Projects
None yet
Development

No branches or pull requests

5 participants