Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 5764199

Browse files
authored
Merge pull request #3 from lightninglabs/fix-floating-point
Laolu Fixes
2 parents 2bfb5e8 + f76fb13 commit 5764199

File tree

6 files changed

+21
-6
lines changed

6 files changed

+21
-6
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ npm run setup
2626

2727
If the window doesn't load after running `npm start`: try clicking on dev tools window and hitting `cmd-r` to refresh the window.
2828

29+
### Logs
30+
Logs are written to the following locations:
31+
32+
* **Linux:** `~/.config/Lightning/log.log`
33+
* **OSX:** `~/Library/Logs/Lightning/log.log`
34+
* **Windows:** `%USERPROFILE%\AppData\Roaming\Lightning\log.log`
35+
2936
### Building
3037

3138
To build binaries for OSX:

packages/lightning-core/accounts/reducer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const actions = {
9494
[GRPC]: {
9595
method: 'walletBalance',
9696
schema: wallet => ({
97-
wallet: wallet.balance * 100000000, // To SAT,
97+
wallet: parseFloat(wallet.balance * 100000000), // To SAT,
9898
}),
9999
},
100100
}),

packages/lightning-core/pay/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { actions as accountsActions } from '../accounts'
77
import { CurrencyInput, Head, Input, Page } from '../common'
88
import { sanitizePaymentRequest } from '../helpers'
99

10-
export const Pay = ({ onMakePayment, onDecodePaymentRequest, onEditForm, onFetchAccount }) => {
10+
export const Pay = ({ onMakePayment, onDecodePaymentRequest, onEditForm,
11+
onFetchAccount, onFetchChannels }) => {
1112
const fields = [
1213
{
1314
name: 'address',
@@ -27,6 +28,7 @@ export const Pay = ({ onMakePayment, onDecodePaymentRequest, onEditForm, onFetch
2728
onMakePayment({ address, amount })
2829
.then(() => {
2930
onFetchAccount()
31+
onFetchChannels()
3032
clear()
3133
})
3234
// eslint-disable-next-line no-console
@@ -75,6 +77,7 @@ export default connect(
7577
onDecodePaymentRequest: actions.decodePaymentRequest,
7678
onEditForm: formActions.editForm,
7779
onFetchAccount: accountsActions.fetchAccount,
80+
onFetchChannels: accountsActions.fetchChannels,
7881
}
7982
)(Pay)
8083

packages/lightning-desktop/main.development.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import _ from 'lodash'
77
import observe from 'observe'
88
import cp from 'child_process'
99
import ps from 'ps-node'
10+
import fileLog from 'electron-log'
1011
import os from 'os'
1112
import lnd from './lnd'
1213

@@ -35,6 +36,7 @@ const runProcesses = (processes, logs) => {
3536
.then(() => {
3637
console.log(`${ proc.name } Already Running`)
3738
logs.push(`${ proc.name } Already Running`)
39+
fileLog.info(`${ proc.name } Already Running`)
3840
})
3941
.catch(() => {
4042
const plat = os.platform()
@@ -49,7 +51,10 @@ const runProcesses = (processes, logs) => {
4951
})
5052
runningProcesses.push(instance)
5153
instance.stdout.on('data', data => logs.push(`${ proc.name }: ${ data }`))
52-
instance.stderr.on('data', data => logs.push(`${ proc.name } Error: ${ data }`))
54+
instance.stderr.on('data', (data) => {
55+
logs.push(`${ proc.name } Error: ${ data }`)
56+
fileLog.error(`${ proc.name }: ${ data }`)
57+
})
5358
} catch (error) {
5459
console.log(`Caught Error When Starting ${ proc.name }: ${ error }`)
5560
logs.push(`Caught Error When Starting ${ proc.name }: ${ error }`)
@@ -195,4 +200,5 @@ app.on('quit', () => {
195200

196201
process.on('uncaughtException', (error) => {
197202
console.log('Caught Main Process Error:', error)
203+
fileLog.error(`Main Process: ${ error }`)
198204
})

packages/lightning-desktop/package.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,8 @@ function startPack() {
9999
]
100100
).then(() => {
101101
if (shouldBuildAll) {
102-
// const archs = ['ia32', 'x64']
103102
const archs = ['x64']
104-
// const platforms = ['linux', 'win32', 'darwin']
105-
const platforms = ['win32', 'darwin']
103+
const platforms = ['linux', 'win32', 'darwin']
106104

107105
platforms.forEach((plat) => {
108106
archs.forEach((arch) => {

packages/lightning-desktop/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"concurrently": "^3.1.0",
2828
"css-loader": "^0.26.1",
2929
"electron-debug": "^1.1.0",
30+
"electron-log": "^2.2.6",
3031
"electron-packager": "^8.4.0",
3132
"electron-prebuilt": "^1.4.6",
3233
"electron-window-state": "^4.0.1",

0 commit comments

Comments
 (0)