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

Commit

Permalink
Adds new wallet creation for old btc wallets
Browse files Browse the repository at this point in the history
  • Loading branch information
NejcZdovc committed Feb 19, 2018
1 parent 83ef68b commit 1e04fd3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion app/browser/api/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ const getStateInfo = (state, parsedData) => {
const info = parsedData.paymentInfo
const then = new Date().getTime() - ledgerUtil.milliseconds.year

if (!parsedData.properties.wallet) {
if (!parsedData.properties || !parsedData.properties.wallet) {
return state
}

Expand Down Expand Up @@ -2026,6 +2026,22 @@ const getContributionAmount = (state) => {
}

const onInitRead = (state, parsedData) => {
const isBTC = parsedData &&
parsedData.properties &&
parsedData.properties.wallet &&
parsedData.properties.wallet.keychains

if (isBTC) {
const fs = require('fs')
fs.renameSync(pathName(statePath), pathName('ledger-state-btc.json'))
state = ledgerState.resetInfo(state)
clientprep()
client = ledgerClient(null, underscore.extend({roundtrip: roundtrip}, clientOptions), null)
parsedData = client.state
getPaymentInfo(state)
muonWriter(statePath, parsedData)
}

if (Array.isArray(parsedData.transactions)) {
parsedData.transactions.sort((transaction1, transaction2) => {
return transaction1.submissionStamp - transaction2.submissionStamp
Expand Down

0 comments on commit 1e04fd3

Please sign in to comment.