From 36e40948a8999893f650b451f1cc283d833cf6f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Fri, 15 Jun 2018 11:25:18 +0200 Subject: [PATCH] In the OUT case we need to add the fees --- src/helpers/libcore.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/helpers/libcore.js b/src/helpers/libcore.js index 0cc0232d..5607fda8 100644 --- a/src/helpers/libcore.js +++ b/src/helpers/libcore.js @@ -312,7 +312,7 @@ function buildOperationRaw({ const bitcoinLikeTransaction = bitcoinLikeOperation.getTransaction() const hash = bitcoinLikeTransaction.getHash() const operationType = op.getOperationType() - const value = op.getAmount().toLong() + let value = op.getAmount().toLong() const fee = op.getFees().toLong() const OperationTypeMap: { [_: $Keys]: OperationType } = { @@ -323,6 +323,10 @@ function buildOperationRaw({ // if transaction is a send, amount becomes negative const type = OperationTypeMap[operationType] + if (type === 'OUT') { + value += fee + } + return { id, hash,