Skip to content
Permalink
Browse files

fix(wallet): store and reuse unused address

  • Loading branch information...
mrfelton committed Apr 28, 2019
1 parent de69c79 commit 02a85ccd124385f285053bf9fda65aee90ead66f
Showing with 2 additions and 3 deletions.
  1. +2 −3 renderer/reducers/address.js
@@ -72,12 +72,11 @@ export const receiveAddressSuccess = ({ type, address }) => async (dispatch, get

// If we know the node's public key, store the address for reuse.
if (pubKey) {
const typeName = Object.keys(addressTypes).find(key => addressTypes[key] === type)
const node = await window.db.nodes.get(pubKey)
if (node) {
await node.setCurrentAddress(typeName, address)
await node.setCurrentAddress(type, address)
} else {
await window.db.nodes.put({ id: pubKey, addresses: { [typeName]: address } })
await window.db.nodes.put({ id: pubKey, addresses: { [type]: address } })
}
}

0 comments on commit 02a85cc

Please sign in to comment.
You can’t perform that action at this time.