Browse Source

fix: only generate a new address on new incoming transaction

Outgoing transactions reference a historical utxo, and do not tie
information to the current receive address, so don't call for
generating a new one.
renovate/lint-staged-8.x
Ben Woosley 7 years ago
parent
commit
b2c9f98f77
No known key found for this signature in database GPG Key ID: 6EE5F3785F78B345
  1. 23
      app/reducers/transaction.js

23
app/reducers/transaction.js

@ -132,17 +132,18 @@ export const newTransaction = (event, { transaction }) => (dispatch, getState) =
dispatch({ type: ADD_TRANSACTION, transaction }) dispatch({ type: ADD_TRANSACTION, transaction })
// HTML 5 desktop notification for the new transaction // HTML 5 desktop notification for the new transaction
const notifTitle = transaction.received if (transaction.received) {
? 'On-chain Transaction Received!' showNotification(
: 'On-chain Transaction Sent!' 'On-chain Transaction Received!',
const notifBody = transaction.received "Lucky you, you just received a new on-chain transaction. I'm jealous."
? "Lucky you, you just received a new on-chain transaction. I'm jealous." )
: "Hate to see 'em go but love to watch 'em leave. Your on-chain transaction successfully sent." dispatch(newAddress('np2wkh')) // Generate a new address
} else {
showNotification(notifTitle, notifBody) showNotification(
'On-chain Transaction Sent!',
// Generate a new address "Hate to see 'em go but love to watch 'em leave. Your on-chain transaction successfully sent."
dispatch(newAddress('np2wkh')) )
}
} }
} }

Loading…
Cancel
Save