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(), } }