From 49466386cf53da4db2f7addeebb52bee9ae5492b Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 10 Jan 2019 10:02:28 -0300 Subject: [PATCH] feature: add getnewaddress on dashboard startup --- app/containers/dashboard.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/containers/dashboard.js b/app/containers/dashboard.js index 03efbce..c17c9eb 100644 --- a/app/containers/dashboard.js +++ b/app/containers/dashboard.js @@ -74,6 +74,24 @@ const mapDispatchToProps = (dispatch: Dispatch) => ({ sortBy('day'), ])(transactions); + if (!zAddresses.length) { + const [getNewZAddressErr, newZAddress] = await eres( + rpc.z_getnewaddress(), + ); + + if (!getNewZAddressErr && newZAddress) { + zAddresses.push(newZAddress); + } + } + + if (!transparentAddresses.length) { + const [getNewAddressErr, newAddress] = await eres(rpc.getnewaddress('')); + + if (!getNewAddressErr && newAddress) { + transparentAddresses.push(newAddress); + } + } + dispatch( loadWalletSummarySuccess({ transparent: walletSummary.transparent,