Move wallet/dispatch functions from main.cpp to wallet.cpp #2868

pull jgarzik wants to merge 4 commits into bitcoin:master from jgarzik:wallet-sep changing 14 files +814 −794
  1. jgarzik commented at 2:55 PM on July 31, 2013: contributor

    After these changes, all code in main.cpp is associated with maintenance of the public blockchain, with one notable exception:

    • callbacks such as EraseFromWallets(), SyncWithWallets(), PrintWallets(), ResendWalletTransactions() which call out from the public blockchain engine into the wallet code

    This change builds upon, and therefore includes and requires, req #2867.

  2. Minor miner fixes (hey hey it's fun to say)
    * Fix UpdateCoins() definition in main.h
    * Remove pwalletMain reference from BitcoinMiner(), as it is passed
      a wallet argument.
    18946846d5
  3. Move internal miner/block creation to separate miner.cpp module.
    Public functions referenced elsewhere are added to miner.h.
    d247a5d130
  4. Move wallet/dispatch functions from main.cpp to wallet.cpp.
    All wallet-related implementation code is now gone from main.cpp.
    A few calls to wallet dispatch functions remain in main.cpp.
    
    All mentions of wallet are gone from main.h.
    2febacc277
  5. Remove dead code function GetWalletFile() 4eba75671c
  6. jgarzik commented at 6:47 PM on July 31, 2013: contributor

    @sipa prefers not to put this in wallet.cpp, closing

    (the ancestor pull req, miner separation, remains open and valid)

  7. jgarzik closed this on Jul 31, 2013

  8. sipa commented at 9:18 PM on July 31, 2013: member

    Wow, I have influence!

    Just to be clear, I do agree with the underlying issue of separating the wallet from the validation core, but IMHO the right way to do so is either by turning the wallet registration functions into boost signals, or by providing a CValidationEventListener in main.h that gets implemented in wallet.

    Perhaps @CodeShark has an opinion about this?

  9. CodeShark commented at 6:09 AM on August 1, 2013: contributor

    Heh, this sounds a little familiar.

    Indeed I do have an opinion about this!

    There is only one standard set of messages in bitcoin at present: the p2p protocol.

    The p2p protocol is the backbone of the network and crucial for the tasks of validation and relay - but it is far too low level for pretty much any other kind of application (including big backend apps like block chain databases as well as wallet apps). A far better architecture would be to have a validation service running on a device which then can have other applications subscribe to it for updates. It would then be simple to insert filters, queues, etc... in order to provide client apps high-level structures that make the client-side logic as simple as possible and can guarantee proper synchronization and push notifications.

    I believe it would be worthwhile to define some high level message types (and support serialization using protobuf, json, and perhaps other standards) and abstract some interfaces for pushing and subscribing to high level messages (i.e. block added to best chain, block removed from best chain, transaction in block with header and merkle path, etc…). I've been working on something along these lines using a library I wrote - however, it would be far more powerful if we could standardize a set of message structures and interfaces.

    From within the same process we could use something like signals (whether boost or otherwise, boost signals are quite resource-intensive but provide a lot of thread-safe features). But exactly how it's implemented is not nearly as important to agree on as the types of messages and the interfaces we use.

    On Jul 31, 2013, at 2:18 PM, Pieter Wuille notifications@github.com wrote:

    Wow, I have influence!

    Just to be clear, I do agree with the underlying issue of separating the wallet from the validation core, but IMHO the right way to do so is either by turning the wallet registration functions into boost signals, or by providing a CValidationEventListener in main.h that gets implemented in wallet.

    Perhaps @CodeShark has an opinion about this?

    — Reply to this email directly or view it on GitHub.

  10. jgarzik deleted the branch on Aug 24, 2014
  11. IntegralTeam referenced this in commit a67e661433 on Jun 4, 2019
  12. 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-20 00:15 UTC

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