pooler / electrum-ltc

Electrum-LTC Litecoin wallet
https://electrum-ltc.org
MIT License
194 stars 100 forks source link

Paying through RPC could be 1 sat lower than the actual payment amount. #314

Open jplix7k opened 11 months ago

jplix7k commented 11 months ago

This is an old bug in electrum code and it got fixed in March this year. Same code is also derived by electrum-ltc.

For example if we set ["address", 0.00033389] in the params of paytomany method via JSONRPC call. It always results in 0.00033388 ltc in transaction. The difference is caused by type casting from Decimal to Int in satoshis function. (https://github.com/pooler/electrum-ltc/blob/master/electrum_ltc/commands.py#L87)

Reproduce the issue by using unittest.

image

It is a safe fix but very valuable because payment precision is an important factor for accounting purpose. Could we please include the fix in next version or coming v4.4.5?

Reference: Issue reported in electrum repo: https://github.com/spesmilo/electrum/issues/8274 Code fix in electrum repo: https://github.com/spesmilo/electrum/commit/7834f6c427594283095274d76ca3203b33df3618

pooler commented 11 months ago

This repo is not currently maintained. The Litecoin Foundation has been working on a port of a newer version of Electrum.

jplix7k commented 11 months ago

Thanks for the prompt reply. Could we confirm we will keep cli/rpc function of Electrum and have the Satoshis function fix in the new Electrum-ltc?

pooler commented 11 months ago

Could we confirm we will keep cli/rpc function of Electrum and have the Satoshis function fix in the new Electrum-ltc?

I would say it's highly likely, but I am not involved with the new port so I really can't say for sure.