2
I'm using Bitcoin API EasyBitcoin-PHP
And also i have my custom transaction fee, that i'd like to pay per each Kb. The problem is that when i used bitcoind v.0.10.2 that was fine and i saw my custom fee (0.0002) in each transaction. But when i've updated to v. 0.13.0 - it just won't work as it should. Here is the simple code, that i'm testing now
$bitcoin = new Bitcoin($user, $password, $host, $port);
$result = $bitcoin->settxfee(0.0002); //returns true
$newTxId = $bitcoin->sendtoaddress('144YsrgtDmRSPC8wUBXLxByCcQAEbV1EUB', 0.001); //returns c3a2fceed1c25624aee8e957c644813bf38808260aad607e623c68e182371ac9
And as you can see in this transaction the fee is 0.000045 BTC, not 0.0002 BTC.
I know, that there was a bug in prev version of bitcoind according to fee rounding, but in new version this bug should be fixed.
Maybe there is another trouble here?
yeah, i know. Here is even github issue for that. https://github.com/bitcoin/bitcoin/issues/7633
and as i can see, they decided to revert feature and now to behaviour should be the same as in old versions. Am i right?
They're only reverted in 0.11, because the change was made without announcement there. What I describe in my answer is the intended behaviour, and the one that is implemented in 0.12 and 0.13. – Pieter Wuille – 2016-10-17T11:55:30.763
oh, i see. So in new versions now it is working lie this... Hm.. not good. 'cos i need to estimate my future transaction size now to show my users what fee would i take away from their payout... and right now i don't know how to estimate it... – Dmitriy Apollonin – 2016-10-17T11:57:48.620
Use create/fundrawtransaction to build your transaction, check the fee, show it, and if agreed to, use signrawtransaction/sendrawtransaction to broadcast it. – Pieter Wuille – 2016-10-17T11:59:47.480
great complication of simple (before) payout process as for users and for developers :( but thanks for the help! – Dmitriy Apollonin – 2016-10-17T12:02:11.557
I understand it complicates things, but there is really no way around it. Fee per byte is what matters to the network. – Pieter Wuille – 2016-10-17T12:04:33.487