-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
Hi, i been testing this lib and i louve it, i found two things that can be improved:
one is to change the OP_RETURN_MAX_BYTES=40 to 80 as the field is now bigger
the other is that i found sometimes a problem with rounding the change amount. It sometimes goes to more than 8 decimal and this is a problem.
I added this small modification to prevent it from happening on the OP_RETURN_send function :
# Calculate amounts and choose inputs
send_amount = round(send_amount,8)
output_amount=round(send_amount+OP_RETURN_BTC_FEE,8)
inputs_spend=OP_RETURN_select_inputs(output_amount, testnet)
if 'error' in inputs_spend:
return {'error': inputs_spend['error']}
change_amount=round(inputs_spend['total']-output_amount,8)
Regards
Carlos
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels