interfaces/wallet: replace raw receive-request string APIs with typed methods #34973

pull itdeveloper1988 wants to merge 1 commits into bitcoin:master from itdeveloper1988:fix/issue-34629 changing 7 files +226 −73
  1. itdeveloper1988 commented at 11:38 PM on March 31, 2026: none

    Replace getAddressReceiveRequests() and setAddressReceiveRequest() with three typed methods on interfaces::Wallet:

    • getReceiveRequests() -> vector<WalletReceiveRequest>
    • addReceiveRequest() -> optional<int64_t> (assigned ID)
    • eraseReceiveRequest() -> bool

    The previous interface passed serialized blobs between the wallet and GUI, forcing GUI code to handle serialization/deserialization of RecentRequestEntry objects directly. This created tight coupling to the wallet storage format and caused the GUI to crash on startup if it encountered a malformed entry.

    The wallet layer now owns:

    • ID assignment (scans existing keys for max ID, assigns max+1)
    • Timestamp generation (calls GetTime() internally)
    • Serialization via Qt-independent mirror structs (RecipientData, RequestEntryData) that are byte-compatible with the existing DB format
    • Graceful error recovery: malformed entries are logged via LogWarning and skipped instead of crashing

    The GUI (RecentRequestsTableModel) no longer contains any serialization logic. The SERIALIZE_METHODS macro, nVersion field, and nReceiveRequestsMaxId tracker are removed from RecentRequestEntry and the table model.

    A regression test is added that writes a malformed blob directly into the wallet address book and verifies getReceiveRequests() returns successfully without crashing.

  2. interfaces/wallet: replace raw receive-request string APIs with typed methods
    Replace getAddressReceiveRequests() and setAddressReceiveRequest() with
    three typed methods on interfaces::Wallet:
    
    - getReceiveRequests()  -> vector<WalletReceiveRequest>
    - addReceiveRequest()   -> optional<int64_t> (assigned ID)
    - eraseReceiveRequest() -> bool
    
    The previous interface passed serialized blobs between the wallet and GUI,
    forcing GUI code to handle serialization/deserialization of RecentRequestEntry
    objects directly. This created tight coupling to the wallet storage format and
    caused the GUI to crash on startup if it encountered a malformed entry.
    
    The wallet layer now owns:
    - ID assignment (scans existing keys for max ID, assigns max+1)
    - Timestamp generation (calls GetTime() internally)
    - Serialization via Qt-independent mirror structs (RecipientData,
      RequestEntryData) that are byte-compatible with the existing DB format
    - Graceful error recovery: malformed entries are logged via LogWarning
      and skipped instead of crashing
    
    The GUI (RecentRequestsTableModel) no longer contains any serialization
    logic. The SERIALIZE_METHODS macro, nVersion field, and nReceiveRequestsMaxId
    tracker are removed from RecentRequestEntry and the table model.
    
    A regression test is added that writes a malformed blob directly into the
    wallet address book and verifies getReceiveRequests() returns successfully
    without crashing.
    9f80342e0f
  3. DrahtBot commented at 11:38 PM on March 31, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #34838 (interfaces: typed receive-request APIs by MkDev11)
    • #33034 (wallet: Store transactions in a separate sqlite table by achow101)
    • #32763 (wallet: Replace CWalletTx::mapValue and vOrderForm with explicit class members by achow101)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

  4. itdeveloper1988 commented at 11:41 PM on March 31, 2026: none

    @johnny9 @achow101 @maflcko Could you please review my PR and let me know feedback? Thanks.

  5. maflcko commented at 6:38 AM on April 1, 2026: member

    instead of creating a duplicate, it would be better to review the duplicate

  6. maflcko closed this on Apr 1, 2026


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-05-02 06:12 UTC

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