add network derivation from redeem.network
This commit is contained in:
parent
1b4dc48d75
commit
a976fba27b
2 changed files with 10 additions and 2 deletions
|
@ -45,7 +45,11 @@ function p2sh (a, opts) {
|
||||||
witness: typef.maybe(typef.arrayOf(typef.Buffer))
|
witness: typef.maybe(typef.arrayOf(typef.Buffer))
|
||||||
}, a)
|
}, a)
|
||||||
|
|
||||||
const network = a.network || BITCOIN_NETWORK
|
let network = a.network
|
||||||
|
if (!network) {
|
||||||
|
network = (a.redeem && a.redeem.network) || BITCOIN_NETWORK
|
||||||
|
}
|
||||||
|
|
||||||
const o = { network }
|
const o = { network }
|
||||||
|
|
||||||
const _address = lazy.value(function () {
|
const _address = lazy.value(function () {
|
||||||
|
|
|
@ -59,7 +59,11 @@ function p2wsh (a, opts) {
|
||||||
})
|
})
|
||||||
const _rchunks = lazy.value(function () { return bscript.decompile(a.redeem.input) })
|
const _rchunks = lazy.value(function () { return bscript.decompile(a.redeem.input) })
|
||||||
|
|
||||||
const network = a.network || BITCOIN_NETWORK
|
let network = a.network
|
||||||
|
if (!network) {
|
||||||
|
network = (a.redeem && a.redeem.network) || BITCOIN_NETWORK
|
||||||
|
}
|
||||||
|
|
||||||
const o = { network }
|
const o = { network }
|
||||||
|
|
||||||
lazy.prop(o, 'address', function () {
|
lazy.prop(o, 'address', function () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue