OutCast3k / coinbin

Javascript Bitcoin Wallet. Supports Multisig, Stealth, HD, SegWit, Bech32, Time Locked Addresses, RBF and more!
https://coinb.in/
MIT License
906 stars 621 forks source link

Fee calculation is wrong #252

Open ghost opened 2 years ago

ghost commented 2 years ago

As per written by

https://github.com/OutCast3k/coinbin/issues/239, https://github.com/OutCast3k/coinbin/issues/240,

Fees should be calculated by the weight size of the transaction, not the type of input value ( If I understanding it correctly )

Example:

https://github.com/spesmilo/electrum/blame/master/electrum/transaction.py#L974

ghost commented 2 years ago

I think this example is much clear

https://github.com/mempool/mempool/blob/master/frontend/src/app/bitcoin.utils.ts