Skip to content

Commit 89de913

Browse files
committed
Fix complete ledgers check on subscription that is not initial
1 parent 6be84bf commit 89de913

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/js/ripple/server.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -636,14 +636,21 @@ Server.prototype._handlePathFind = function(message) {
636636
};
637637

638638
/**
639-
* Handle subscription response messages. Subscription response
640-
* messages indicate that a connection to the server is ready
639+
* Handle initial subscription response message. The server is considered
640+
* `connected` after it has received a response to initial subscription to
641+
* ledger and server streams
641642
*
642643
* @param {Object} message
643644
* @api private
644645
*/
645646

646647
Server.prototype._handleResponseSubscribe = function(message) {
648+
if (this.isConnected()) {
649+
// This function only concerns initializing the server's internal
650+
// state after a connection
651+
return;
652+
}
653+
647654
if (!this._remote._allow_partial_history
648655
&& !Server.hasFullLedgerHistory(message)) {
649656
// Server has partial history and Remote has been configured to disallow

0 commit comments

Comments
 (0)