RemovePrunedFunds / ImportPrunedFunds with multiple wallet outputs #12115

issue AdvancedStyle openend this issue on January 8, 2018
  1. AdvancedStyle commented at 8:59 am on January 8, 2018: none

    Case:

    You have a transaction which has multiple outputs to different addresses in your own wallet (let’s say 2 for example). One of the output has already been spent, and the other is unspent.

    The problem is that if you import this transaction into your wallet using ImportPrunedFunds it will add both the unspent and spent amounts to your listunspent.

    And if you use RemovePrunedFunds it will remove both the unspent and spent amounts.

    Suggested Handling

    RemovePrunedFunds / ImportPrunedFunds should accept an additional optional vout parameter, so that you can specify exactly which vout you want to add or remove as a UTXO

  2. fanquake added the label Wallet on Jan 8, 2018
  3. MarcoFalke commented at 1:10 am on January 13, 2018: member

    According to the documentation, “The end-user is responsible to import additional transactions that subsequently spend the imported outputs or rescan after the point in the blockchain the transaction is included.”

    Imo, this can be closed.

  4. MarcoFalke added the label Questions and Help on Jan 13, 2018
  5. AdvancedStyle commented at 1:35 am on January 13, 2018: none

    In my case that would be manually importing 1000s of transactions in order to correct it all the way up the chain; node is pruned then no possibility to rescan (hence whole point of the importprunedfunds)

    A way to only import specific vouts from the import transaction would be much easier.

  6. MarcoFalke removed the label Questions and Help on Jan 13, 2018
  7. TheBlueMatt commented at 5:08 pm on January 14, 2018: member
    If you’re manually watching which outputs are available you can probably also manually select outpouts to spend from when creating a transaction. As @MarcoFalke points out, the “correct” solution is to import all the transactions the wallet needs to know the current state of things. How are you exporting transactions to give to the pruned node? If you’re using another Core daemon it may be useful to consider adding an RPC which, when provided with a set of output scripts in the wallet, provides all the transactions it knows how to export to make it easier to get all the available transactions.
  8. AdvancedStyle commented at 11:40 pm on January 14, 2018: none

    How are you exporting transactions to give to the pruned node? https://chainquery.com/bitcoin-api/gettxoutproof

    In my case there are only a few transactions to import, so can be done manually by grabbing the rawtx and gettxoutproof from chainquery.

    Situation is this: After 100000s of transactions the bitcoin core wallet starts to respond extremely slowly (once wallet.dat is over 500-600MB. A workable solution is to dump the private keys, destroy the wallet and then re-import the private keys (basically erasing the history)….wallet then start responding quickly as normal.

    However there are then some large older transactions which need to be re-imported.

    There are 1000s of transactions after the older transactions, so re-importing all these would, as you said, require creating a script to do this and building some kind of import dump.

    Rescan would defeat the purpose because wallet would have all the history again and would slow down.

    The only feasible solution was to manually re-spend all the older transactions to put them back into the current view, but this is a poor solution.

  9. MarcoFalke commented at 10:30 pm on May 8, 2020: member

    The feature request didn’t seem to attract much attention in the past. Also, the issue seems not important enough right now to keep it sitting around idle in the list of open issues.

    Closing due to lack of interest. Pull requests with improvements are always welcome.

  10. MarcoFalke closed this on May 8, 2020

  11. 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 00:12 UTC

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