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

Correctly extract pubkeyScript from witness data #555

Merged
merged 1 commit into from
Apr 11, 2018
Merged

Conversation

pm47
Copy link
Member

@pm47 pm47 commented Apr 10, 2018

When publishing delayed txes, we need to first watch the parent
transaction in order to know how many confirmations it has.

Electrum relies on hashes of pubkeyScripts in order to track
transactions.

In order to do this without having the parent transaction at hand,
we recompute the pubkeyScript from the child transaction witness data
and give it to Electrum.

But if the script was a pay2wsh, we were using the redeemScript
instead of computing the pubkeyScript.

This is the root cause of ACINQ/eclair-mobile#17.

When publishing delayed txes, we need to first watch the parent
transaction in order to know how many confirmations it has.

Electrum relies on hashes of `pubkeyScript`s in order to track
transactions.

In order to do this without having the parent transaction at hand,
we recompute the `pubkeyScript` from the child transaction witness data
and give it to Electrum.

But if the script was a `pay2wsh`, we were using the `redeemScript`
instead of computing the `pubkeyScript`.
@pm47 pm47 requested a review from sstone April 10, 2018 18:15
@pm47 pm47 merged commit 91c6645 into master Apr 11, 2018
@pm47 pm47 deleted the electrum-watch-parent branch April 11, 2018 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants