Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Commit

Permalink
Use ledger-client@0.9.15 and handle some timing issues
Browse files Browse the repository at this point in the history
Fixes #8423
  • Loading branch information
mrose17 committed Apr 21, 2017
1 parent 1e01c9e commit 9196257
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 58 deletions.
5 changes: 4 additions & 1 deletion app/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,7 @@ var initialize = (paymentsEnabled) => {
getStateInfo(state)

try {
var timeUntilReconcile
clientprep()
client = ledgerClient(state.personaId,
underscore.extend(state.options, { roundtrip: roundtrip }, clientOptions),
Expand All @@ -679,7 +680,7 @@ var initialize = (paymentsEnabled) => {
// Scenario: User enables Payments, disables it, waits 30+ days, then
// enables it again -> reconcileStamp is in the past.
// In this case reset reconcileStamp to the future.
let timeUntilReconcile = client.timeUntilReconcile()
try { timeUntilReconcile = client.timeUntilReconcile() } catch (ex) {}
let ledgerWindow = (synopsis.options.numFrames - 1) * synopsis.options.frameSize
if (typeof timeUntilReconcile === 'number' && timeUntilReconcile < -ledgerWindow) {
client.setTimeUntilReconcile(null, (err, stateResult) => {
Expand Down Expand Up @@ -1856,6 +1857,8 @@ var getStateInfo = (state) => {
var info = state.paymentInfo
var then = underscore.now() - msecs.year

if (!state.properties.wallet) return

ledgerInfo.paymentId = state.properties.wallet.paymentId
ledgerInfo.passphrase = state.properties.wallet.keychains.passphrase

Expand Down
147 changes: 91 additions & 56 deletions npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"keytar": "^3.0.0",
"l20n": "^3.5.1",
"ledger-balance": "^0.9.0",
"ledger-client": "^0.9.14",
"ledger-client": "^0.9.15",
"ledger-geoip": "^0.9.0",
"ledger-publisher": "^0.9.4",
"lru-cache": "^1.0.0",
Expand Down

0 comments on commit 9196257

Please sign in to comment.