Browse Source

Merge pull request #866 from gre/optimistic-op-id

Use another representation for op id to fix Details blink
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
c86e896f18
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/commands/libcoreSignAndBroadcast.js
  2. 5
      src/helpers/libcore.js

2
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,

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

Loading…
Cancel
Save