From b88ebb3f4e1ce5df1e3fe4371a278c8678950337 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Wed, 5 Sep 2018 17:09:32 +0200 Subject: [PATCH] feat(lnd): update lnd to latest master build --- app/lib/utils/btc.js | 23 +++++------------------ app/lib/zap/controller.js | 2 +- app/reducers/invoice.js | 5 +---- package.json | 2 +- resources/rpc.proto | 4 ++-- 5 files changed, 10 insertions(+), 26 deletions(-) diff --git a/app/lib/utils/btc.js b/app/lib/utils/btc.js index 86773e73..80f913ca 100644 --- a/app/lib/utils/btc.js +++ b/app/lib/utils/btc.js @@ -25,12 +25,12 @@ export function btcToBits(btc) { export function btcToFiat(btc, price) { const amount = parseFloat(btc * price).toFixed(2) - return (btc > 0 && amount <= 0) ? '< 0.01' : numberWithCommas(amount) + return btc > 0 && amount <= 0 ? '< 0.01' : numberWithCommas(amount) } //////////////////////////// // bits to things ///////// -////////////////////////// +////////////////////////// export function bitsToBtc(bits, price) { if (bits === undefined || bits === null || bits === '') return null @@ -41,7 +41,7 @@ export function bitsToBtc(bits, price) { export function bitsToSatoshis(bits, price) { if (bits === undefined || bits === null || bits === '') return null - + return bits * 100 } @@ -54,7 +54,7 @@ export function bitsToFiat(bits, price) { //////////////////////////// // satoshis to things ///// -////////////////////////// +////////////////////////// export function satoshisToBtc(satoshis) { if (satoshis === undefined || satoshis === null || satoshis === '') return null @@ -76,17 +76,6 @@ export function satoshisToFiat(satoshis, price) { return btcToFiat(satoshisToBtc(satoshis), price) } -//////////////////////////////// -// millisatoshis to satoshis // -////////////////////////////// - -export function millisatoshisToSatoshis(millisatoshis) { - if (millisatoshis === undefined || millisatoshis === null || millisatoshis === '') return null - - return Math.round(millisatoshis / 1000) -} - - export function renderCurrency(currency) { switch (currency) { case 'btc': @@ -97,7 +86,7 @@ export function renderCurrency(currency) { return 'satoshis' default: return 'satoshis' - } + } } export function convert(from, to, amount, price) { @@ -156,8 +145,6 @@ export default { satoshisToBits, satoshisToFiat, - millisatoshisToSatoshis, - renderCurrency, convert diff --git a/app/lib/zap/controller.js b/app/lib/zap/controller.js index 3eaab660..83aeb8f8 100644 --- a/app/lib/zap/controller.js +++ b/app/lib/zap/controller.js @@ -386,7 +386,7 @@ class ZapController { const shutdownTimeout = setTimeout(() => { this.neutrino.removeListener('close', closeHandler) if (this.neutrino) { - mainLog.warn('Graceful shutdown failed to complete within 30 seconds.') + mainLog.warn('Graceful shutdown failed to complete within 10 seconds.') this.neutrino.kill() resolve() } diff --git a/app/reducers/invoice.js b/app/reducers/invoice.js index 160b633c..095d7f81 100644 --- a/app/reducers/invoice.js +++ b/app/reducers/invoice.js @@ -40,10 +40,7 @@ export const UPDATE_INVOICE = 'UPDATE_INVOICE' // Decorate invoice object with custom/computed properties. const decorateInvoice = invoice => { - invoice.finalAmount = invoice.value - if (invoice.amt_paid) { - invoice.finalAmount = btc.millisatoshisToSatoshis(invoice.amt_paid) - } + invoice.finalAmount = invoice.amt_paid ? invoice.amt_paid : invoice.value return invoice } diff --git a/package.json b/package.json index fbc87c63..22183fe4 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "config": { "style_paths": "app/styles/*.scss app/components/**/*.scss", "lnd-binary": { - "binaryVersion": "0.4.2-beta-913-g26f68da5", + "binaryVersion": "0.5-beta-rc1-52-gbaee07ef", "binarySite": "https://github.com/LN-Zap/lnd/releases/download" } }, diff --git a/resources/rpc.proto b/resources/rpc.proto index 15ab5fff..6d6e45c8 100644 --- a/resources/rpc.proto +++ b/resources/rpc.proto @@ -1,4 +1,4 @@ -// Imported from https://github.com/lightningnetwork/lnd/blob/26f68da5b2883885fcf6a8e79b3fc9bb12cc9eef/lnrpc/rpc.proto +// Imported from https://github.com/lightningnetwork/lnd/blob/baee07ef480c15a731e0c87dc98d27269c5a80fa/lnrpc/rpc.proto syntax = "proto3"; // import "google/api/annotations.proto"; @@ -23,7 +23,7 @@ package lnrpc; * * More information on how exactly the gRPC documentation is generated from * this proto file can be found here: - * https://github.com/MaxFangX/lightning-api + * https://github.com/lightninglabs/lightning-api */ // The WalletUnlocker service is used to set up a wallet password for