From 89de91301e682a46dc60aaacc7ae152e8fe1b7c7 Mon Sep 17 00:00:00 2001 From: wltsmrz Date: Wed, 14 Jan 2015 17:19:21 -0800 Subject: [PATCH] Fix complete ledgers check on subscription that is not initial --- src/js/ripple/server.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/js/ripple/server.js b/src/js/ripple/server.js index b439f80a..582f8652 100644 --- a/src/js/ripple/server.js +++ b/src/js/ripple/server.js @@ -636,14 +636,21 @@ Server.prototype._handlePathFind = function(message) { }; /** - * Handle subscription response messages. Subscription response - * messages indicate that a connection to the server is ready + * Handle initial subscription response message. The server is considered + * `connected` after it has received a response to initial subscription to + * ledger and server streams * * @param {Object} message * @api private */ Server.prototype._handleResponseSubscribe = function(message) { + if (this.isConnected()) { + // This function only concerns initializing the server's internal + // state after a connection + return; + } + if (!this._remote._allow_partial_history && !Server.hasFullLedgerHistory(message)) { // Server has partial history and Remote has been configured to disallow