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! // NB we don't check isCancelled() because the broadcast is not cancellable now!
onOperationBroadcasted({ onOperationBroadcasted({
id: txHash, id: `${account.xpub}-${txHash}-OUT`,
hash: txHash, hash: txHash,
type: 'OUT', type: 'OUT',
value: transaction.amount, value: transaction.amount,

5
src/helpers/libcore.js

@ -428,7 +428,6 @@ function buildOperationRaw({
op: NJSOperation, op: NJSOperation,
xpub: string, xpub: string,
}): OperationRaw { }): OperationRaw {
const id = op.getUid()
const bitcoinLikeOperation = op.asBitcoinLikeOperation() const bitcoinLikeOperation = op.asBitcoinLikeOperation()
const bitcoinLikeTransaction = bitcoinLikeOperation.getTransaction() const bitcoinLikeTransaction = bitcoinLikeOperation.getTransaction()
const hash = bitcoinLikeTransaction.getHash() const hash = bitcoinLikeTransaction.getHash()
@ -448,6 +447,8 @@ function buildOperationRaw({
value += fee value += fee
} }
const id = `${xpub}-${hash}-${type}`
return { return {
id, id,
hash, hash,
@ -458,7 +459,7 @@ function buildOperationRaw({
recipients: op.getRecipients(), recipients: op.getRecipients(),
blockHeight: op.getBlockHeight(), blockHeight: op.getBlockHeight(),
blockHash: null, blockHash: null,
accountId: xpub, accountId: xpub, // FIXME accountId: xpub !?
date: op.getDate().toISOString(), date: op.getDate().toISOString(),
} }
} }

Loading…
Cancel
Save