From d00e924965273a739c5e9bc3343e307efe056491 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sun, 3 Sep 2017 11:29:59 -0700 Subject: [PATCH] hd: use buffer pool for key derivation. --- lib/hd/private.js | 2 +- lib/hd/public.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/hd/private.js b/lib/hd/private.js index 3dfbeff2..1711b31f 100644 --- a/lib/hd/private.js +++ b/lib/hd/private.js @@ -199,7 +199,7 @@ HDPrivateKey.prototype.derive = function derive(index, hardened) { if (cache) return cache; - const bw = new StaticWriter(37); + const bw = StaticWriter.pool(37); if (index & common.HARDENED) { bw.writeU8(0); diff --git a/lib/hd/public.js b/lib/hd/public.js index b93feebd..e4928671 100644 --- a/lib/hd/public.js +++ b/lib/hd/public.js @@ -165,7 +165,7 @@ HDPublicKey.prototype.derive = function derive(index, hardened) { if (cache) return cache; - const bw = new StaticWriter(37); + const bw = StaticWriter.pool(37); bw.writeBytes(this.publicKey); bw.writeU32BE(index);