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

P2SH/P2WSH payments .network should use .redeem.network if undefined #1232

Merged
merged 4 commits into from
Sep 26, 2018

Conversation

dcousens
Copy link
Contributor

The default network now favours that which is defined...

@@ -59,7 +59,11 @@ function p2wsh (a, opts) {
})
const _rchunks = lazy.value(function () { return bscript.decompile(a.redeem.input) })

const network = a.network || BITCOIN_NETWORK
let network = a.network
if (!network) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this could be a.network || (a.redeem && a.redeem.network) || BITCOIN_NETWORK

@@ -96,10 +96,11 @@ function preform (x) {
if (x.pubkeys) x.pubkeys = x.pubkeys.map(fromHex)
if (x.signatures) x.signatures = x.signatures.map(function (y) { return Number.isFinite(y) ? y : Buffer.from(y, 'hex') })
if (x.redeem) {
x.redeem = Object.assign({}, x.redeem)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was frustrating

@dcousens dcousens requested a review from junderw September 26, 2018 06:06
@junderw
Copy link
Member

junderw commented Sep 26, 2018

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants