From 548ca590d529e6cf69222185d2ce86af606f095c Mon Sep 17 00:00:00 2001 From: xcps Date: Sun, 17 Mar 2019 00:44:43 +0500 Subject: [PATCH] Keep-alive with wallet --- bin/syncBlockchain.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bin/syncBlockchain.js b/bin/syncBlockchain.js index 5b16be0..1083002 100644 --- a/bin/syncBlockchain.js +++ b/bin/syncBlockchain.js @@ -7,6 +7,9 @@ var rpcConfig = require('../config/config')['rpc']; const {username, password, hostname, port} = rpcConfig; +const keepAliveAgent = new http.Agent({ keepAlive: true }); + + let sync_sql = '', coolstrs = []; @@ -18,6 +21,7 @@ function MakeRPCRequest(postData) { auth: `${username}:${password}`, path: '/', method: 'POST', + agent: keepAliveAgent, headers: { 'Content-Type': 'application/x-www-form-urlencoded', 'Content-Length': Buffer.byteLength(postData)