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);