Spent per txout #122

pull sipa wants to merge 1 commits into bitcoin:master from sipa:00d326da75c18e79a8d2c1e81965c4ad5cbf5138 changing 2 files +145 −43
  1. sipa commented at 9:58 PM on March 17, 2011: member

    This patch changes some internal structures to keep track of spentness of each wallet transaction output separately, to support partially-spent transactions. It contains:

    • an update to the data structures (vfSpent in CWalletTx instead of fSpent)
    • a backward-compatible update to the wallet disk format (written by Satoshi, Gavin knows). Old clients reading back an updated wallet will ignore partially spent transactions when creating new ones, and may report a wrong balance, though.
    • some helper functions (CWalletTx: IsSpent, MarkSpent, MarkDirty to reset cached values, GetAvailableCredit which only counts unredeemed outputs)
    • update to SelectCoins and CreateTransaction to select source transaction outputs separately instead of per whole transaction. This fixes the issue mentioned in http://www.bitcoin.org/smf/index.php?topic=3759.0

    The reason for writing this patch: i'm also working on an import/export wallet patch, where situations with partially spent transactions become hard to avoid.

    Everything except loading a new wallet into an old client is tested on the testnet, including crafted situations with partially-spent transactions.

  2. Spent per txout
    Change some internal data structures to keep track of spentness of each wallet transaction output separately, to support partially-spent transactions:
    * an update to the data structures (vfSpent in CWalletTx instead of fSpent)
    * a backward-compatible update to the wallet disk format. Old clients reading back an updated wallet will ignore partially spent transactions when creating new ones, and may report a wrong balance, though.
    * some helper functions (CWalletTx: IsSpent, MarkSpent, MarkDirty to reset cached values, GetAvailableCredit which only counts unredeemed outputs)
    00d326da75
  3. sipa closed this on Mar 17, 2011

  4. glv2 referenced this in commit 00d26672b8 on May 21, 2014
  5. glv2 referenced this in commit 186ef9fe10 on Oct 8, 2014
  6. sipa referenced this in commit a064934ec0 on Dec 4, 2014
  7. sipa referenced this in commit 87bddb7a3a on Dec 4, 2014
  8. sipa referenced this in commit eb6347679b on Dec 5, 2014
  9. dexX7 referenced this in commit 8e55e3dea4 on Jul 9, 2015
  10. rebroad referenced this in commit c596b82abc on Mar 16, 2016
  11. rebroad referenced this in commit d0c3341a3a on Dec 7, 2016
  12. deadalnix referenced this in commit 3c0ae43d66 on Jan 19, 2017
  13. classesjack referenced this in commit 403c2e70f8 on Jan 2, 2018
  14. 0xartem referenced this in commit 60e7473749 on Feb 19, 2018
  15. attilaaf referenced this in commit c6db1a16bd on Jan 13, 2020
  16. rajarshimaitra referenced this in commit 9cf761e4d2 on Mar 23, 2021
  17. rajarshimaitra referenced this in commit 70f843eeeb on Aug 5, 2021
  18. DrahtBot locked this on Sep 8, 2021

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: 2026-04-13 21:16 UTC

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