Return undefined instead of a null signature
This commit is contained in:
parent
dc6ff32290
commit
ff82ccec71
|
@ -43,7 +43,7 @@ MultiSigScriptHashInput.prototype.toObject = function() {
|
||||||
MultiSigScriptHashInput.prototype._deserializeSignatures = function(signatures) {
|
MultiSigScriptHashInput.prototype._deserializeSignatures = function(signatures) {
|
||||||
return _.map(signatures, function(signature) {
|
return _.map(signatures, function(signature) {
|
||||||
if (!signature) {
|
if (!signature) {
|
||||||
return signature;
|
return undefined;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
publicKey: new PublicKey(signature.publicKey),
|
publicKey: new PublicKey(signature.publicKey),
|
||||||
|
@ -59,7 +59,7 @@ MultiSigScriptHashInput.prototype._deserializeSignatures = function(signatures)
|
||||||
MultiSigScriptHashInput.prototype._serializeSignatures = function() {
|
MultiSigScriptHashInput.prototype._serializeSignatures = function() {
|
||||||
return _.map(this.signatures, function(signature) {
|
return _.map(this.signatures, function(signature) {
|
||||||
if (!signature) {
|
if (!signature) {
|
||||||
return signature;
|
return undefined;
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
publicKey: signature.publicKey.toString(),
|
publicKey: signature.publicKey.toString(),
|
||||||
|
|
|
@ -98,7 +98,7 @@ UnspentOutput.prototype.toJSON = function() {
|
||||||
*/
|
*/
|
||||||
UnspentOutput.prototype.toObject = function() {
|
UnspentOutput.prototype.toObject = function() {
|
||||||
return {
|
return {
|
||||||
address: this.address.toString(),
|
address: this.address ? this.address.toString() : undefined,
|
||||||
txid: this.txId,
|
txid: this.txId,
|
||||||
vout: this.outputIndex,
|
vout: this.outputIndex,
|
||||||
scriptPubKey: this.script.toBuffer().toString('hex'),
|
scriptPubKey: this.script.toBuffer().toString('hex'),
|
||||||
|
|
Loading…
Reference in New Issue