#4 do not add empty redeem script name
This commit is contained in:
parent
f1d04cec00
commit
09a0eb9779
4 changed files with 8 additions and 4 deletions
|
@ -95,7 +95,8 @@ function p2sh(a, opts) {
|
|||
});
|
||||
lazy.prop(o, 'name', () => {
|
||||
const nameParts = ['p2sh'];
|
||||
if (o.redeem !== undefined) nameParts.push(o.redeem.name);
|
||||
if (o.redeem !== undefined && o.redeem.name !== undefined)
|
||||
nameParts.push(o.redeem.name);
|
||||
return nameParts.join('-');
|
||||
});
|
||||
if (opts.validate) {
|
||||
|
|
|
@ -118,7 +118,8 @@ function p2wsh(a, opts) {
|
|||
});
|
||||
lazy.prop(o, 'name', () => {
|
||||
const nameParts = ['p2wsh'];
|
||||
if (o.redeem !== undefined) nameParts.push(o.redeem.name);
|
||||
if (o.redeem !== undefined && o.redeem.name !== undefined)
|
||||
nameParts.push(o.redeem.name);
|
||||
return nameParts.join('-');
|
||||
});
|
||||
// extended validation
|
||||
|
|
|
@ -118,7 +118,8 @@ export function p2sh(a: Payment, opts?: PaymentOpts): Payment {
|
|||
});
|
||||
lazy.prop(o, 'name', () => {
|
||||
const nameParts = ['p2sh'];
|
||||
if (o.redeem !== undefined) nameParts.push(o.redeem.name!);
|
||||
if (o.redeem !== undefined && o.redeem.name !== undefined)
|
||||
nameParts.push(o.redeem.name!);
|
||||
return nameParts.join('-');
|
||||
});
|
||||
|
||||
|
|
|
@ -132,7 +132,8 @@ export function p2wsh(a: Payment, opts?: PaymentOpts): Payment {
|
|||
});
|
||||
lazy.prop(o, 'name', () => {
|
||||
const nameParts = ['p2wsh'];
|
||||
if (o.redeem !== undefined) nameParts.push(o.redeem.name!);
|
||||
if (o.redeem !== undefined && o.redeem.name !== undefined)
|
||||
nameParts.push(o.redeem.name!);
|
||||
return nameParts.join('-');
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue