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) {
|
||||
return _.map(signatures, function(signature) {
|
||||
if (!signature) {
|
||||
return signature;
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
publicKey: new PublicKey(signature.publicKey),
|
||||
|
@ -59,7 +59,7 @@ MultiSigScriptHashInput.prototype._deserializeSignatures = function(signatures)
|
|||
MultiSigScriptHashInput.prototype._serializeSignatures = function() {
|
||||
return _.map(this.signatures, function(signature) {
|
||||
if (!signature) {
|
||||
return signature;
|
||||
return undefined;
|
||||
}
|
||||
return {
|
||||
publicKey: signature.publicKey.toString(),
|
||||
|
|
|
@ -98,7 +98,7 @@ UnspentOutput.prototype.toJSON = function() {
|
|||
*/
|
||||
UnspentOutput.prototype.toObject = function() {
|
||||
return {
|
||||
address: this.address.toString(),
|
||||
address: this.address ? this.address.toString() : undefined,
|
||||
txid: this.txId,
|
||||
vout: this.outputIndex,
|
||||
scriptPubKey: this.script.toBuffer().toString('hex'),
|
||||
|
|
Loading…
Reference in New Issue