PeerAssets / chizukeki

チズケキ PeerAssets-able Peercoin web wallet.
https://peerassets.github.io/chizukeki/
BSD 3-Clause "New" or "Revised" License
3 stars 6 forks source link

chizukeki seems to be paying excessive fees #32

Closed peerchemist closed 6 years ago

peerchemist commented 6 years ago

This deck spawn transaction payed 0.1 tppc in fees.

https://chainz.cryptoid.info/ppc-test/tx.dws?3d9d9f65d6d442e95598f758df39a5b9125b307fa97aaabbac8f1b918c685264.htm

micimize commented 6 years ago

This is probably hardcoded somewhere and easy to fix what should the amount be?

peerchemist commented 6 years ago

It should be calculating the fee, individually per transaction. Cost is 0.01ppc/kB

peerchemist commented 6 years ago

Apparently bitcore does the transaction fee calculation within the Transaction object: https://bitcore.io/api/lib/transaction

Not sure does it need to be modified for the Peercoin.

nohea commented 6 years ago

Try explicitly setting bitcore.Transaction.feePerKb = "0.01" when building the tx

https://github.com/PeerAssets/chizukeki/blob/9dc1af6994ef41e8ecb44236894d57c766bb3bf5/src/lib/bitcore-peerassets.ts#L86

https://github.com/bitpay/bitcore-lib/blob/86583608814dfc513e675d7b853806caf9bd95e7/lib/transaction/transaction.js#L752