electrum-ltc icon indicating copy to clipboard operation
electrum-ltc copied to clipboard

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

Open jplix7k opened this issue 2 years ago • 3 comments

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

jplix7k avatar Jul 19 '23 02:07 jplix7k

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

pooler avatar Jul 19 '23 08:07 pooler

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?

jplix7k avatar Jul 20 '23 01:07 jplix7k

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.

pooler avatar Jul 20 '23 08:07 pooler