Skip to content

Bugfix: correctly compute transfer amount

Carles Barrobés requested to merge transfer-fee-bug into develop

How to reproduce the error:

  • on a local Duniter-v2 test node transfer e.g. 1GD from Alice to Bob
  • outcome: 2GD are being transferred, rather than the expected 1GD

This error was compounded by 3 factors:

  • Transaction fees are already applied by the network/blockchain, so clients don't need to do anything special
  • Transaction fees were being added to the transfer amount (Alice to Bob) so they went to Bob and not the treasury
  • Fees were multiplied by 100, so rather than the expected 0.01GD, we were appyling 1GD


  • Simply just not add transfer fees to the transaction

Additionally, there was an issue where the check for available balance was done using the wrong amount units (cents rather than GD), and the fees in configuration data were incorrect for GDev. These issues have also been addressed in this MR.

This is the proof of the blockchain logic already adding fees (which incidentally are 2GD cents and not 1 as stated by Cesium):


However, the blockchain ATM also refunds the fees as a follow-up system event, as part of the blockchain rules:


Edited by Carles Barrobés

Merge request reports