From f54c63d2e8b073d93b6c1c4948293753ba527c3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Thu, 5 Jul 2018 23:22:15 +0200 Subject: [PATCH] Fix fees in the optimistic updates --- src/commands/libcoreSignAndBroadcast.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/commands/libcoreSignAndBroadcast.js b/src/commands/libcoreSignAndBroadcast.js index fc0e909a..409e809c 100644 --- a/src/commands/libcoreSignAndBroadcast.js +++ b/src/commands/libcoreSignAndBroadcast.js @@ -208,13 +208,15 @@ export async function doSignAndBroadcast({ .asBitcoinLikeAccount() .broadcastRawTransaction(Array.from(Buffer.from(signedTransaction, 'hex'))) + const fee = builded.getFees().toLong() + // NB we don't check isCancelled() because the broadcast is not cancellable now! onOperationBroadcasted({ id: `${account.xpub}-${txHash}-OUT`, hash: txHash, type: 'OUT', - value: transaction.amount, - fee: 0, + value: transaction.amount + fee, + fee, blockHash: null, blockHeight: null, senders: [account.freshAddress],