Fix default assignment of validate key for payments
Fixes problems with p2ms experienced in issue below. Related: #1194
This commit is contained in:
parent
20551fd380
commit
24d541d0ed
7 changed files with 7 additions and 7 deletions
|
@ -19,7 +19,7 @@ function p2data (a, opts) {
|
||||||
!a.data &&
|
!a.data &&
|
||||||
!a.output
|
!a.output
|
||||||
) throw new TypeError('Not enough data')
|
) throw new TypeError('Not enough data')
|
||||||
opts = opts || { validate: true }
|
opts = Object.assign({ validate: true }, opts || {})
|
||||||
|
|
||||||
typef({
|
typef({
|
||||||
network: typef.maybe(typef.Object),
|
network: typef.maybe(typef.Object),
|
||||||
|
|
|
@ -24,7 +24,7 @@ function p2ms (a, opts) {
|
||||||
!(a.pubkeys && a.m !== undefined) &&
|
!(a.pubkeys && a.m !== undefined) &&
|
||||||
!a.signatures
|
!a.signatures
|
||||||
) throw new TypeError('Not enough data')
|
) throw new TypeError('Not enough data')
|
||||||
opts = opts || { validate: true }
|
opts = Object.assign({ validate: true }, opts || {})
|
||||||
|
|
||||||
function isAcceptableSignature (x) {
|
function isAcceptableSignature (x) {
|
||||||
return bscript.isCanonicalScriptSignature(x) || (opts.allowIncomplete && (x === OPS.OP_0))
|
return bscript.isCanonicalScriptSignature(x) || (opts.allowIncomplete && (x === OPS.OP_0))
|
||||||
|
|
|
@ -16,7 +16,7 @@ function p2pk (a, opts) {
|
||||||
!a.input &&
|
!a.input &&
|
||||||
!a.signature
|
!a.signature
|
||||||
) throw new TypeError('Not enough data')
|
) throw new TypeError('Not enough data')
|
||||||
opts = opts || { validate: true }
|
opts = Object.assign({ validate: true }, opts || {})
|
||||||
|
|
||||||
typef({
|
typef({
|
||||||
network: typef.maybe(typef.Object),
|
network: typef.maybe(typef.Object),
|
||||||
|
|
|
@ -18,7 +18,7 @@ function p2pkh (a, opts) {
|
||||||
!a.pubkey &&
|
!a.pubkey &&
|
||||||
!a.input
|
!a.input
|
||||||
) throw new TypeError('Not enough data')
|
) throw new TypeError('Not enough data')
|
||||||
opts = opts || { validate: true }
|
opts = Object.assign({ validate: true }, opts || {})
|
||||||
|
|
||||||
typef({
|
typef({
|
||||||
network: typef.maybe(typef.Object),
|
network: typef.maybe(typef.Object),
|
||||||
|
|
|
@ -26,7 +26,7 @@ function p2sh (a, opts) {
|
||||||
!a.redeem &&
|
!a.redeem &&
|
||||||
!a.input
|
!a.input
|
||||||
) throw new TypeError('Not enough data')
|
) throw new TypeError('Not enough data')
|
||||||
opts = opts || { validate: true }
|
opts = Object.assign({ validate: true }, opts || {})
|
||||||
|
|
||||||
typef({
|
typef({
|
||||||
network: typef.maybe(typef.Object),
|
network: typef.maybe(typef.Object),
|
||||||
|
|
|
@ -21,7 +21,7 @@ function p2wpkh (a, opts) {
|
||||||
!a.pubkey &&
|
!a.pubkey &&
|
||||||
!a.witness
|
!a.witness
|
||||||
) throw new TypeError('Not enough data')
|
) throw new TypeError('Not enough data')
|
||||||
opts = opts || { validate: true }
|
opts = Object.assign({ validate: true }, opts || {})
|
||||||
|
|
||||||
typef({
|
typef({
|
||||||
address: typef.maybe(typef.String),
|
address: typef.maybe(typef.String),
|
||||||
|
|
|
@ -28,7 +28,7 @@ function p2wsh (a, opts) {
|
||||||
!a.redeem &&
|
!a.redeem &&
|
||||||
!a.witness
|
!a.witness
|
||||||
) throw new TypeError('Not enough data')
|
) throw new TypeError('Not enough data')
|
||||||
opts = opts || { validate: true }
|
opts = Object.assign({ validate: true }, opts || {})
|
||||||
|
|
||||||
typef({
|
typef({
|
||||||
network: typef.maybe(typef.Object),
|
network: typef.maybe(typef.Object),
|
||||||
|
|
Loading…
Reference in a new issue