From 3f24e87c541c58683955fd50033091fc957ed6cd Mon Sep 17 00:00:00 2001 From: Daniel Cousens Date: Sun, 1 Jun 2014 16:04:44 +1000 Subject: [PATCH] HDWallet: more explicit branch for parentFingerprint --- src/hdwallet.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hdwallet.js b/src/hdwallet.js index cfcc5fe..1283750 100644 --- a/src/hdwallet.js +++ b/src/hdwallet.js @@ -157,7 +157,7 @@ HDWallet.prototype.toBuffer = function(priv) { buffer.writeUInt8(this.depth, 4) // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key) - var fingerprint = this.depth ? this.parentFingerprint : 0x00000000 + var fingerprint = (this.depth === 0) ? 0x00000000 : this.parentFingerprint buffer.writeUInt32BE(fingerprint, 5) // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.