Nit: There are a lot of getFee(1000)'s. I don't have an objection to them, although on first reading I was confused ('what is this magic 1000 number'). But instead of suggesting defining a constant BYTES_PER_KB :p I think it would be nicer to have a function getFeePerKB() that's simply an inline for getFee(1000).