What makes me wonder, this happens just for some transactions
Take a look at this transaction: 20179d0d2fba68b2ca82ab8cc5faa39ced73324af6b90b6505cca2c3d65102a6
As you can see inputs/outputs fee is: 0.001 BTC
In bitcoin-core gettransaction
bitcoin-cli gettransaction "20179d0d2fba68b2ca82ab8cc5faa39ced73324af6b90b6505cca2c3d65102a6" true
Returns this result:
Array
(
[amount] => -105.21509845
[fee] => 105.11519845
[confirmations] => 78
[blockhash] => 0000000000004caf7faef44b3cd20424b04e8044a8d323064e1fca6864b96cb9
[blockindex] => 18
[blocktime] => 1517902289
[txid] => 20179d0d2fba68b2ca82ab8cc5faa39ced73324af6b90b6505cca2c3d65102a6
[walletconflicts] => Array
(
)
[time] => 1517902198
[timereceived] => 1517902198
[bip125-replaceable] => no
[details] => Array
(
[0] => Array
(
[involvesWatchonly] => 1
[account] =>
[address] => 2N2QxAHtCMMDpxTxuNNNHvDh4burprspWPN
[category] => send
[amount] => -0.1625
[vout] => 0
[fee] => 105.11519845
[abandoned] =>
)
[1] => Array
(
[involvesWatchonly] => 1
[account] =>
[address] => 2MtuDKij5ueE4C9D5wjA3Ft9bkjMJByxr4d
[category] => send
[amount] => -105.05259845
[vout] => 1
[fee] => 105.11519845
[abandoned] =>
)
)
But with this transaction everything is fine:
20179d0d2fba68b2ca82ab8cc5faa39ced73324af6b90b6505cca2c3d65102a6
bitcoin-cli gettransaction "20179d0d2fba68b2ca82ab8cc5faa39ced73324af6b90b6505cca2c3d65102a6" true
Result:
Array
(
[amount] => -1.049
[fee] => -0.001
[confirmations] => 136
[blockhash] => 0000000000000fd2e83cc1a8145b055a1a33ea996f7a93578197a48848201a5b
[blockindex] => 1
[blocktime] => 1517898674
[txid] => b0ad2f8047b6bfc6a0da4947ec7cda59ccf423df2d24dcbf2996042cdf45c10a
[walletconflicts] => Array
(
)
[time] => 1517898650
[timereceived] => 1517898650
[bip125-replaceable] => no
[details] => Array
(
[0] => Array
(
[involvesWatchonly] => 1
[account] =>
[address] => mxKPZ2rnev5odtFTqS273946YgQfY7H6E5
[category] => send
[amount] => -0.0001
[vout] => 0
[fee] => -0.001
[abandoned] =>
)
[1] => Array
(
[involvesWatchonly] => 1
[account] =>
[address] => 2NG1QAAFsM71L7YwVxkjSeMbKYpW6KFURXs
[category] => send
[amount] => -1.0489
[vout] => 1
[fee] => -0.001
[abandoned] =>
)
)
to get the fee of that type of transactions we could do:
105.21509845 (amount) - 105.11519845(fee) = 0.001
But why bitcoin core doesn’t do it and why it’s only for some transactions?