From 532edf670e8c30db958765141974f3fb0f5ec44c Mon Sep 17 00:00:00 2001 From: Dan Finlay Date: Wed, 20 Apr 2016 09:29:37 -0700 Subject: Store metamaskId on metaTx instead of getTxWithParams method. --- app/scripts/lib/idStore.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'app/scripts/lib/idStore.js') diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js index 66194fd41..7763d33d8 100644 --- a/app/scripts/lib/idStore.js +++ b/app/scripts/lib/idStore.js @@ -135,6 +135,7 @@ IdentityStore.prototype.addUnconfirmedTransaction = function(txParams, cb){ // create txData obj with parameters and meta data var time = (new Date()).getTime() var txId = createId() + txParams.metamaskId = txId var txData = { id: txId, txParams: txParams, @@ -337,10 +338,13 @@ function IdManagement(opts) { txParams.gasLimit = ethUtil.addHexPrefix(txParams.gasLimit || txParams.gas) txParams.nonce = ethUtil.addHexPrefix(txParams.nonce) var tx = new Transaction(txParams) + + // Add the tx hash to the persisted meta-tx object var hash = '0x' + tx.hash().toString('hex') - var txLog = configManager.getTxWithParams(txParams) - txLog.hash = hash - configManager.updateTx(txLog) + var metaTx = configManager.getTx(txParams.metamaskId) + metaTx.hash = hash + configManager.updateTx(metaTx) + var rawTx = '0x'+tx.serialize().toString('hex') return '0x'+LightwalletSigner.signTx(this.keyStore, this.derivedKey, rawTx, txParams.from, this.hdPathString) } -- cgit v1.2.3