Incorrect amount in transaction page #29378

issue cornwarecjp openend this issue on February 3, 2024
  1. cornwarecjp commented at 9:25 pm on February 3, 2024: none

    Is there an existing issue for this?

    • I have searched the existing issues

    Current behaviour

    In the Bitcoin Core GUI, I exported the transaction list to csv. Using a spreadsheet program, I added up all transaction amounts in the CSV file. The sum didn’t equal the available amount on the overview page of Bitcoin Core.

    The available amount on the overview page does correspond to the sum of my UTXO amounts (as seen using coin control in the Bitcoin Core GUI). It also corresponds to the balance I calculated using a Python script I made (which reads data from wallet.dat).

    I found that only a single transaction shows a different amount than my own Python script. This is transaction 0dade8f478b376f669736f4dd1fe4234084e20a62be2dccae39fa6c57028c256. The amount for this transaction in the CSV is the same as on the transaction page of the Bitcoin Core GUI.

    This transaction is completely a payment to self: all keys of all input and all outputs are in this wallet. In my own script, this transaction adds 0.0009 BTC to the balance; Bitcoin Core shows it as adding 0.0069 BTC to my balance. Neither is (technically) correct.

    Expected behaviour

    Since transaction 0dade8f478b376f669736f4dd1fe4234084e20a62be2dccae39fa6c57028c256 is completely a payment from this wallet to itself, its effect to the balance should be -1 * fee = -0.0002 BTC. I understand why my own script shows a different amount: my script doesn’t recognize the 0.0011 BTC multisig input of this tx as something owned by myself.

    For Bitcoin Core, I’d either expect it to

    • do the same as my script (not recognizing the multisig something owned by myself), so this tx has a balance impact of 0.0011 - 0.0002 = 0.0009 BTC, or to
    • recognize the multsig, so this tx has a balance impact of -0.0002; and the tx that created the multisig should have a correspondingly different amount, so the total ends up correct.

    Right now, Bitcoin Core does neither, and I have no idea what the 0.0069 BTC for this tx is based on. It’s as if it accounts the output, but none of the inputs of this tx.

    Steps to reproduce

    This is a very old wallet that has been used with lots of different Bitcoin Core versions, and in the past I’ve been doing a lot of messing around with it (like pushing raw transactions with non-standard scripts). I’m not 100% sure whether this is a bug, or a historical artifact of my past messing around. I considered it better to report it anyway, just for the possibility of it being a bug.

    Relevant log output

    In the console window, I did the following:

     0gettransaction 0dade8f478b376f669736f4dd1fe4234084e20a62be2dccae39fa6c57028c256
     1{
     2  "amount": 0.00000000,
     3  "fee": 0.00090000,
     4  "confirmations": 498487,
     5  "blockhash": "00000000000000001b5e8b521bba0be38cd398c3c9231c4cbdb529457e014392",
     6  "blockheight": 330260,
     7  "blockindex": 558,
     8  "blocktime": 1416137418,
     9  "txid": "0dade8f478b376f669736f4dd1fe4234084e20a62be2dccae39fa6c57028c256",
    10  "wtxid": "0dade8f478b376f669736f4dd1fe4234084e20a62be2dccae39fa6c57028c256",
    11  "walletconflicts": [
    12  ],
    13  "time": 1416134931,
    14  "timereceived": 1416134931,
    15  "bip125-replaceable": "no",
    16  "details": [
    17    {
    18      "address": "12h9WiT6oowtx6AKd2eE8K2J4BNtAykPuA",
    19      "category": "send",
    20      "amount": -0.00690000,
    21      "label": "Alles naar zelfde adres terug",
    22      "vout": 0,
    23      "fee": 0.00090000,
    24      "abandoned": false
    25    },
    26    {
    27      "address": "12h9WiT6oowtx6AKd2eE8K2J4BNtAykPuA",
    28      "parent_descs": [
    29      ],
    30      "category": "receive",
    31      "amount": 0.00690000,
    32      "label": "Alles naar zelfde adres terug",
    33      "vout": 0
    34    }
    35  ],
    36  "hex": "010000000a1f0b8eb4d75fc96cd523484b20cedd7dd876455f31485bbfd7fa41c41ee29a9100000000910048304502210085c5799395d220977988f492e0989dcf998752ea2c629721e842059fd65fc6fd022022e249f582563782ddc83898ba1983099357c998a4f66539229eebf22e191d4501463043021f1cdd20c348546f76a424936d60520c7a67ce560f9ae5341bdc8c23a88abcc3022079178f54ca28043c45c54843b8e295d644ca6ba7426d16992d1263ccb529b6d401ffffffff1f0b8eb4d75fc96cd523484b20cedd7dd876455f31485bbfd7fa41c41ee29a91010000006b483045022027ce01967871d5c197b485e5ac466a07e48933a4681c5114fe7da446a3034c53022100b066626b0e634ebd2d706586b715956e318d540f4e4b0e6757a7887d89b9c7e5012102c8d4a740ae5a4d20419341b7e66972f7463ab041929dbc1008197d368cd4c28afffffffffe8ea01d50069ffd24824775920c5f26f1e55f17c1b299c665340af401297d71000000008c4930460221008971592a1725d1248dc4e3c945a168ac8aca02090754612cfd514e9787389ffb022100ccad3326b5a0fa875dd900e27a661298961a39a4e93a45335da136a5ffeb8ef60141047f57e6e8ea7e8ddedceebc2ce66b5052fe84f84f2e97db39f7c62d50de046542b5eec51e63c34a4dbdf3ff0dc8a7df838368d185789f594c91aff4259906ad8affffffff1852f9ec9c53c51f4f8b221856a1cf0933ddeee537fd9878ceb3ce53a51f6e78000000008b483045022100faeb45378419f064572656241690637c71531d9dde6bbf6dfc59804ea4727751022057969927cfe4a2984b521756044d05df675783fb02a1b1acb8638c7a3996cff80141047f57e6e8ea7e8ddedceebc2ce66b5052fe84f84f2e97db39f7c62d50de046542b5eec51e63c34a4dbdf3ff0dc8a7df838368d185789f594c91aff4259906ad8affffffffc10db9e81b33a1ba4f42acc42377935b4793d9e6db715692ee205ba9612e24dc010000008b483045022100aa0837ec8357e1e1f83071c42ab2b327b3ba0606dbf6a283b8d3a7641680f07a02207769e960adcba5f339707478615d7caca320774b5d225f6dce19a1946b2209a10141042699826040eed0218fd39d2f8750d57beb56bd8895eb32a03074234e80111179e63db7b1de3842f9c8c58574c11953b5dbdcf1392e8b8e1b982cb51c3895a660ffffffff3a66d19979e39342c93fb167682b8e185d19c4374df6a2b09136b376f4eda18a000000008a47304402203b93c61401be1016e1054e659a634ba763c52e3d505a6a5e5e3670d00b08e0f10220443f181d45504c48bd8d4c13f9d79a55a75437be9657676ff013c0c1c47a0e180141047f57e6e8ea7e8ddedceebc2ce66b5052fe84f84f2e97db39f7c62d50de046542b5eec51e63c34a4dbdf3ff0dc8a7df838368d185789f594c91aff4259906ad8affffffff3a66d19979e39342c93fb167682b8e185d19c4374df6a2b09136b376f4eda18a010000008b483045022054d5561a7304ed5b4b3457b92e14f1b1aeee021ea28c30e1d3313bb8c7e0f2a8022100ff2782b181da54843c3bfadf7071ca1742230b02429db7518ed196c65bb76de001410499e122189c66ea16596cf621abe3480c31052b199a0afe8a52c1051713b4bd582a3f8aeab2d1913911d28c968baf46ec9f72f70b8b62f3a9a74993de20992469ffffffffd103628b3e1324ee6e5720b6b1813794f2139c30833126bf3d949007d18abeae000000008a47304402205894dab4f2e026c8f08eac4aff5fc1da72c470051fc370fbbe659b151993a65c02202e5734a6a2a7055d641f97a378365b38a565b258d3a3484a85496b9973bf299b0141047f57e6e8ea7e8ddedceebc2ce66b5052fe84f84f2e97db39f7c62d50de046542b5eec51e63c34a4dbdf3ff0dc8a7df838368d185789f594c91aff4259906ad8affffffffe84d08f181b3e964f52285b4289cb248fcd284272866a8f818ae298e64d06a9c000000008c493046022100801e6ac5acb44cd8b4dbf1a294ad3e92f7eeba843f8a47f37cb7d7e733011a4e022100d124d9e7cc3d8479774cc3b310251bf461ce73a881c58de5d14968495a77cb390141047f57e6e8ea7e8ddedceebc2ce66b5052fe84f84f2e97db39f7c62d50de046542b5eec51e63c34a4dbdf3ff0dc8a7df838368d185789f594c91aff4259906ad8affffffffe84d08f181b3e964f52285b4289cb248fcd284272866a8f818ae298e64d06a9c010000008c493046022100c6da3714a44938bb05111f3a30b415a7dbf5540cdffe54da6ec8ac64a175d912022100e08e017b969c101ba015cdbd2d01aa5a031c7e116a90781defdb3e405e5e8bdb01410499e122189c66ea16596cf621abe3480c31052b199a0afe8a52c1051713b4bd582a3f8aeab2d1913911d28c968baf46ec9f72f70b8b62f3a9a74993de20992469ffffffff0150870a00000000001976a914128fdeb73efcea378a3bc126695d5b5506e8c0ca88ac00000000"
    37}
    

    How did you obtain Bitcoin Core

    Compiled from source

    What version of Bitcoin Core are you using?

    v25.0.0

    Operating system and version

    Debian 12

    Machine specifications

    No response

  2. achow101 commented at 10:16 pm on February 3, 2024: member
    Can you try using 26.0? Display of send to self txs in the gui (and therefore in what the csv contains) was changed in 26.0 and I think that will more accurately reflect the state of these transactions.
  3. glozow added the label Wallet on Feb 5, 2024
  4. maflcko added the label Questions and Help on Feb 6, 2024
  5. maflcko added the label GUI on Feb 6, 2024
  6. maflcko closed this on Feb 6, 2024

  7. maflcko commented at 10:13 am on February 6, 2024: member
    Closing for now, as it seems to be fixed?
  8. cornwarecjp commented at 12:45 pm on February 9, 2024: none

    ACK, it’s fixed: in version 26, the transaction shows as +0.0009 BTC, and the total of the transaction amounts equals the wallet balance.

    Note to future readers of this issue: when you add up the amounts in the CSV file, don’t forget to skip the amounts of the non-confirmed transactions (e.g. ones that have been RBFed).


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-09-28 22:12 UTC

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