Some transactions are not shown in listtransactions output #19856

issue du2zy openend this issue on September 1, 2020
  1. du2zy commented at 1:57 pm on September 1, 2020: none

    I have two bitcoin core full nodes. I have one wallet.dat file on both nodes. One node is a master and second node is a reserve. Master signs and sends transactions. Reserve node only receives updates from network. I create new addresses on the master node only and the reserve node derives the same addresses.

    I don’t use any other commands on the reserve node. The reserve node creates addresses automatically after receiving a transaction to a new address. This process is possible due to using BIP32 key derivation from one master key.

    So, I have constantly synchronized master and reserve nodes. If there are problems with the master, then I switch to the reserve.

    I see some strange behavior appear during this process. Some transactions are not shown in the listtransactions output. I did a research an found that only “in-wallet” transactions are not shown in the listransactions. The “in-wallet” transactions are transactions that were sent with sender’s and receiver’s keys, which are stored in my wallet. I also found that new addresses on the reserve node are created whithout a label.

    After adding a label to the address the problem is gone. But adding a label requires additional steps I want to avoid.

    Expected Behavior

    Results of listtransactions also shown “in-wallet” transactions to addresses without labels

    Current Behavior

    Results of listtransactions doesn’t shown “in-wallet” transactions to addresses without labels

    Possible Solution

    • Automatic adding of a default label to the addresses, derived to the reserve node.

    • Print transactions sent to addresses without labels in listtransactions.

    Steps to Reproduce

    1. Run and sync full nodes A and B.

    2. Stop nodes A and B.

    3. Copy wallet.dat from node A to node B.

    4. Run nodes A and B

    5. Use getnewaddress method on node A 10 times. Let’s assume the 10-th address is $ADDRESS.

    6. Use sendtoaddress method on node A. Send 0.001 coins from another address to the $ADDRESS. bitcoin-cli sendtoaddress $ADDRESS 0.001. Let’s assume the result txid is $TXID.

    7. Use listtransaction "*" method on node B. You don’t see the $TXID transaction in list.

    8. Use gettransactions, or listunspent methods on node B. You can see the transaction details. Wallet balance changed on node B and is equal to node A.

    9. Use getaddressinfo $ADDRESS method on node A. You can see that address had the default label ("").

    10. Use getaddressinfo $ADDRESS method on node B. You can see that the address doesn’t have any label.

    Context (Environment)

    The problem is occured on any version of bitcoin core testnet and mainnet. The problem is also occured on litecoin and any bitcoin-based coins.

  2. du2zy added the label Bug on Sep 1, 2020
  3. laanwj added the label Wallet on Sep 3, 2020
  4. achow101 commented at 7:50 pm on August 9, 2021: member

    It looks like this is primarily due to how change detection works. Essentially, outputs that go to the wallet are detected as change, because, by definition, that is what change is. So your send-to-self transactions do not appear in listtransactions because they are being detected as change.

    Generally it is not advised to have the same wallet loaded in multiple places as you get unexpected behavior like what you are seeing. A lot of the wallet’s change detection functionality is based on user actions within the wallet (like requesting addresses), and so it can kind of break when you have a wallet where the user isn’t interacting with it directly (i.e. node B).

  5. MarcoFalke commented at 9:10 am on August 27, 2021: member
    Can this be closed as not-a-bug?
  6. S3RK commented at 4:01 pm on August 27, 2021: member

    I believe it’s a bug. The bug also appears if you would restore a HD wallet from backup and with some metadata lost.

    It’s technically possible to fix that and I have a draft proposal on how to do it. But need to discuss more in the wallet meeting.

  7. ghost commented at 4:42 pm on August 27, 2021: none

    But need to discuss more in the wallet meeting

    When is wallet meeting? I need to discuss few things as well

  8. michaelfolkson commented at 4:50 pm on August 27, 2021: contributor
    @prayank23: Today at 19:00 UTC. I encourage you (and @S3RK) to preregister a topic using #proposedwalletmeetingtopic in the #bitcoin-core-dev Libera channel if you have topics to discuss :)
  9. laanwj closed this on Dec 2, 2021

  10. DrahtBot locked this on Dec 2, 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-17 15:12 UTC

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