From 2127ddbada5f79d5debc87bd37dad753d8bcc6cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Thu, 5 Jul 2018 13:06:19 +0200 Subject: [PATCH] Use another representation for op id to fix Details blink --- src/commands/libcoreSignAndBroadcast.js | 2 +- src/helpers/libcore.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index 63740653..fc0e909a 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -210,7 +210,7 @@ export async function doSignAndBroadcast({ // NB we don't check isCancelled() because the broadcast is not cancellable now! onOperationBroadcasted({ - id: txHash, + id: `${account.xpub}-${txHash}-OUT`, hash: txHash, type: 'OUT', value: transaction.amount, diff --git a/src/helpers/libcore.js b/src/helpers/libcore.js index b4148c49..db4dbe15 100644 --- a/src/helpers/libcore.js +++ b/src/helpers/libcore.js @@ -428,7 +428,6 @@ function buildOperationRaw({ op: NJSOperation, xpub: string, }): OperationRaw { - const id = op.getUid() const bitcoinLikeOperation = op.asBitcoinLikeOperation() const bitcoinLikeTransaction = bitcoinLikeOperation.getTransaction() const hash = bitcoinLikeTransaction.getHash() @@ -448,6 +447,8 @@ function buildOperationRaw({ value += fee } + const id = `${xpub}-${hash}-${type}` + return { id, hash, @@ -458,7 +459,7 @@ function buildOperationRaw({ recipients: op.getRecipients(), blockHeight: op.getBlockHeight(), blockHash: null, - accountId: xpub, + accountId: xpub, // FIXME accountId: xpub !? date: op.getDate().toISOString(), } }