]> git.ktnx.net Git - mobile-ledger.git/commit
JSON transaction parser: detect file-order stream and disable the early termination...
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 4 Apr 2019 06:41:06 +0000 (09:41 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 4 Apr 2019 06:41:06 +0000 (09:41 +0300)
commit0996c57ac91f80b69373dc287469a56259a57e03
tree5c43ce87e17abe92058a72539ab298d444c96ceb
parentb18cd774a08afb15f9c3b953508b4823211c547b
JSON transaction parser: detect file-order stream and disable the early termination logic

the early termination logic is useful when transactions come in reverse
chronological order -- newest first. seeing 50 known transactions
seems like a good criteria for terminating the parsing before the whole
stream is processed

however, the JSON API seems to return transactions in file order --
oldest first (by time of creation, not 'date' field). in this order
the newest (and thus unknown) transactions come last and the early
termination logic needs to be disabled
app/src/main/java/net/ktnx/mobileledger/async/RetrieveTransactionsTask.java