Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitcoinlib.wallets.WalletError: Fee of 773 is lower then minimal network fee of 1000 #56

Closed
slush0 opened this issue Nov 2, 2018 · 3 comments
Labels

Comments

@slush0
Copy link
Contributor

slush0 commented Nov 2, 2018

Hi,

while using 'litecoind' service provider, wallet.transaction_create() proposed transaction with fee bellow "fee_min" defined in networks.json and sending of transaction failed.

Code triggering the error (as you see, I don't touch fee estimation in any way):

lock_script = b'\x6a' + varstr(data)
t_output = Output(0, lock_script=lock_script)
tx = wallet.send([t_output])
@slush0
Copy link
Contributor Author

slush0 commented Nov 2, 2018

After finding on internetz, it looks like minimum fee on LTC is 1000 sat, bu "per kB". In https://github.com/1200wd/bitcoinlib/blob/master/bitcoinlib/wallets.py#L2762 there's comparsion of fee_min with absolute transaction fee, which fails for small transactions and small suggested fees.

@mccwdev
Copy link
Member

mccwdev commented Nov 2, 2018

Yes indeed, looks like a mix-up of fee per kilobyte and total transaction fee in the transaction_create() method. I think both are available in this method so it should be easy to fix. Not sure why I didn't notice this earlier...

@mccwdev mccwdev added the bug label Nov 2, 2018
@mccwdev
Copy link
Member

mccwdev commented Nov 6, 2018

Fixed in https://github.com/1200wd/bitcoinlib/tree/fix-fee-mixups.
Fee estimation needs some more work to make it more precise and include segwit, but for now it seems to work.

@mccwdev mccwdev closed this as completed Nov 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants