From 3c481246582a1a701085df304be48f9c5071426e Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 23 Oct 2016 03:24:32 -0700 Subject: [PATCH] lint. --- lib/node/spvnode.js | 4 ++-- lib/primitives/merkleblock.js | 2 +- lib/wallet/walletblock.js | 25 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/lib/node/spvnode.js b/lib/node/spvnode.js index 026fe62b..8bd035b6 100644 --- a/lib/node/spvnode.js +++ b/lib/node/spvnode.js @@ -245,9 +245,9 @@ SPVNode.prototype.rescan = function rescan() { * @returns {Promise} */ -SPVNode.prototype.scan = co(function* scan(height) { +SPVNode.prototype.scan = function scan(height) { return this.walletdb.rescan(this.chain.db, height); -}); +}; /** * Broadcast a transaction (note that this will _not_ be verified diff --git a/lib/primitives/merkleblock.js b/lib/primitives/merkleblock.js index 44f3b6e8..bbb56a71 100644 --- a/lib/primitives/merkleblock.js +++ b/lib/primitives/merkleblock.js @@ -418,7 +418,7 @@ MerkleBlock.fromRaw = function fromRaw(data, enc) { MerkleBlock.prototype.toFull = function toFull(writer) { var p = BufferWriter(writer); - var i, tx; + var i, tx, index; this.toRaw(p); diff --git a/lib/wallet/walletblock.js b/lib/wallet/walletblock.js index 3a75beda..1a38e851 100644 --- a/lib/wallet/walletblock.js +++ b/lib/wallet/walletblock.js @@ -299,6 +299,31 @@ function cmpid(a, b) { return a.id - b.id; } +function parseWallets(data) { + var p = new BufferReader(data); + var wids = []; + + while (p.left()) + wids.push(p.readU32()); + + return wids; +} + +function serializeWallets(wids, writer) { + var p = new BufferWriter(writer); + var i, wid; + + for (i = 0; i < wids.length; i++) { + wid = wids[i]; + p.writeU32(wid); + } + + if (!writer) + p = p.render(); + + return p; +} + /* * Expose */