-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Refactoring extractInput
and __build
to enable nested scripts
#540
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
Conversation
90d4ac1
to
cd72141
Compare
|
||
// Ignore empty scripts | ||
if (txIn.script.length === 0) return {} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved this into extractInput
so in the future it can first check if it's segwit
cd72141
to
e583014
Compare
|
||
// ready to sign? | ||
var signatureScript = input.redeemScript || input.prevOutScript | ||
signatureScript = signatureScript || input.redeemScript || input.prevOutScript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
preperation for segwit, where the signatureScript
could be different from the redeemScript
e583014
to
f6ef01f
Compare
if (allowIncomplete) { | ||
for (var i = 0; i < msSignatures.length; ++i) { | ||
msSignatures[i] = msSignatures[i] || ops.OP_0 | ||
var processScript = function (scriptType, parentType, redeemScript) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved into a function so that we can call it again for nested scripts (P2SH[ P2WSH[ P2PKH / multsig ] ]
)
f6ef01f
to
122a86d
Compare
extractInputs
and __build
to enable nested scriptsextractInput
and __build
to enable nested scripts
|
122a86d
to
867065b
Compare
Needs rebase. |
…2SH[ P2PKH / multsig ]`). This is preperation for the segwit support which will have `P2SH[ P2WSH[ P2PKH / multsig ] ]` scripts
867065b
to
7aaae4c
Compare
Refactoring `extractInput` and `__build` to enable nested scripts
@rubensayshi can you work from within this repository if possible? It makes collaboration easier :) |
This is preperation for the segwit support which will have
P2SH[ P2WSH[ P2PKH / multsig ] ]
scripts.It's only refactoring code, shouldn't contain any function changes and should make the #520 PR easier to diff once merged.
Considering the following possible scripts we want to support: https://gist.github.com/rubensayshi/fbe39657e90ef416d411