Skip to content

Commit 57b7030

Browse files
committed
[FIX] change handling of requestLedger options
ledger_index and ledger_hash were being set to true instead of the specified value, and according to API docs 'closed','validated', and 'current' can be supplied to the ledger_index field to get the most recent of the specified type
1 parent eeba86f commit 57b7030

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/js/ripple/remote.js

+11-2
Original file line numberDiff line numberDiff line change
@@ -949,10 +949,19 @@ Remote.prototype.requestLedger = function(options, callback) {
949949
case 'expand':
950950
case 'transactions':
951951
case 'accounts':
952-
case 'ledger_index':
953-
case 'ledger_hash':
954952
request.message[o] = true;
955953
break;
954+
955+
case 'ledger_index':
956+
case 'ledger_hash':
957+
request.message[o] = options[o];
958+
break;
959+
960+
case 'closed' :
961+
case 'current' :
962+
case 'validated' :
963+
request.message.ledger_index = o;
964+
break;
956965
}
957966
}, options);
958967
break;

0 commit comments

Comments
 (0)