Skip to content

add support for user-set txn fees

Luke Champine requested to merge wallet-fee into master

This allows you to do:

$ siac wallet send siacoins -fee 10SC [amount] [addr]

This should be useful for power users that need to prioritize certain transactions.

I'm not super happy with the backend code (SendSiacoinsFee). An alternative would be to add an extra argument to SendSiacoins, but this requires changing dozens of calls to SendSiacoins throughout the codebase. We could get around this by making the fee an "optional argument" (using ...) but historically we've avoided that pattern and I think we should continue avoiding it. Lastly, we could move the logic into the api package. That is, the api handler would create a txnbuilder and apply the fee itself. This is ugly in its own way, but the ugliness feels somewhat justified since this is an edge case, and doing so avoids avoids polluting the rest of the code (the wallet module wouldn't change at all).

This also needs api tests.

Merge request reports