Browse Source

In the OUT case we need to add the fees

master
Gaëtan Renaudeau 7 years ago
parent
commit
36e40948a8
  1. 6
      src/helpers/libcore.js

6
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<typeof core.OPERATION_TYPES>]: 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,

Loading…
Cancel
Save