Bitcoin-core 0.15.1 gettransaction showing wrong fee for some transactions #12364

issue AdamSEY openend this issue on February 6, 2018
  1. AdamSEY commented at 2:48 pm on February 6, 2018: none

    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?

  2. fanquake added the label RPC/REST/ZMQ on Feb 7, 2018
  3. MarcoFalke added the label Wallet on Feb 7, 2018
  4. TheBlueMatt commented at 10:17 pm on February 19, 2018: member
    Can you post the result of “validateaddress 2MtuDKij5ueE4C9D5wjA3Ft9bkjMJByxr4d” on this wallet? Specifially, the ismine, iswatchonly, and account fields?
  5. AdamSEY commented at 4:11 am on February 20, 2018: none
    0{
    1  "isvalid": true,
    2  "address": "2MtuDKij5ueE4C9D5wjA3Ft9bkjMJByxr4d",
    3  "scriptPubKey": "a9141227609741861c537c70c9ecd3e879a388dd2c4587",
    4  "ismine": false,
    5  "iswatchonly": false,
    6  "isscript": true,
    7  "iswitness": false
    8}
    
  6. MarcoFalke commented at 1:25 am on April 26, 2020: member
    I don’t think it is possible for the wallet to calculate the fee of non-wallet transactions. Closing for now.
  7. MarcoFalke closed this on Apr 26, 2020

  8. MarcoFalke commented at 10:21 pm on May 11, 2020: member
    Well, this looks like a duplicate of #14136. So closing for that reason and retracting my previous reason to close.
  9. MarcoFalke locked this on Feb 15, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-24 15:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me