aboutsummaryrefslogtreecommitdiff
path: root/src/validationinterface.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright headers to 2018DrahtBot2018-07-271-1/+1
|
* Remove useless mapRequest tracking that just effects Qt display.Matt Corallo2018-07-091-10/+0
| | | | | | | I thought we had removed this a long time ago, TBH, its really confusing feedback to users that we display whether a tx was broadcast to immediate neighbor nodes, given that has little indication of whether the tx propagated very far.
* Drop unused init.h includesBen Woosley2018-06-251-1/+0
| | | | | | These were entirely unused, as based on successful compilation and a grep for: \bStartShutdown\(\)|\bShutdownRequested\(\)|\bInterrupt\(\)|\bShutdown\(\)|\bInitLogging\(\)|\bInitParameterInteraction\(\)|\bAppInitBasicSetup\(\)|\bAppInitParameterInteraction\(\)|\bAppInitSanityChecks\(\)|\bAppInitLockDataDirectory\(\)|\bAppInitMain\(\)|\bSetupServerArgs\(\)|\bLicenseInfo\(\)|g_wallet_init_interface|init.h
* scripted-diff: Rename SetBestChain callback ChainStateFlushedMatt Corallo2018-04-271-6/+6
| | | | | | | | This much more accurately captures the meaning of the callback. -BEGIN VERIFY SCRIPT- sed -i 's/SetBestChain/ChainStateFlushed/g' src/validationinterface.h src/validationinterface.cpp src/wallet/wallet.h src/wallet/wallet.cpp src/validation.cpp src/index/txindex.h src/index/txindex.cpp -END VERIFY SCRIPT-
* Hold cs_main while calling UpdatedBlockTip() and ui.NotifyBlockTipJesse Cohen2018-04-161-0/+4
| | | | | Ensures that callbacks are invoked in the order in which the chain is updated Resolves #12978
* Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|
* Add helper to wait for validation interface queue to catch upMatt Corallo2017-12-261-0/+12
|
* Add an interface to get the queue depth out of CValidationInterfaceMatt Corallo2017-12-261-0/+5
|
* Fix shutdown in case of errors during initializationWladimir J. van der Laan2017-11-281-1/+6
| | | | | | | | PR #10286 introduced a few steps which are not robust to early shutdown in initialization. Stumbled upon this with #11781, not sure if there are other scenarios that can trigger it, but it's harden against this in any case.
* scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
* Give ZMQ consistent order with UpdatedBlockTip on scheduler threadMatt Corallo2017-10-131-1/+3
| | | | | | Note that UpdatedBlockTip is also used in net_processing to announce new blocks to peers. As this may need additional review, this change is included in its own commit.
* Also call other wallet notify callbacks in scheduler threadMatt Corallo2017-10-131-6/+16
| | | | | | | | | | | | | | This runs Block{Connected,Disconnected}, SetBestChain, Inventory, and TransactionAddedToMempool on the background scheduler thread. Of those, only BlockConnected is used outside of Wallet/ZMQ, and is used only for orphan transaction removal in net_processing, something which does not need to be synchronous with anything else. This partially reverts #9583, re-enabling some of the gains from #7946. This does not, however, re-enable the gains achieved by repeatedly releasing cs_main between each transaction processed.
* Add CallFunctionInQueue to wait on validation interface queue drainMatt Corallo2017-10-131-0/+4
|
* Call TransactionRemovedFromMempool in the CScheduler threadMatt Corallo2017-10-131-1/+3
| | | | | | | This is both good practice (we want to move all such callbacks into a background thread eventually) and prevents a lock inversion when we go to use this in wallet (mempool.cs->cs_wallet and cs_wallet->mempool.cs would otherwise both be used).
* Add a CValidationInterface::TransactionRemovedFromMempoolMatt Corallo2017-10-131-0/+19
| | | | | | This is currently unused, but will by used by wallet to cache when transactions are in the mempool, obviating the need for calls to mempool from CWalletTx::InMempool()
* Fix validationinterface build on super old boost/clangMatt Corallo2017-10-021-0/+2
| | | | | This should fix all the non-dependancy issues for termux builds. See Github issue #11388.
* Declare single-argument (non-converting) constructors "explicit"practicalswift2017-08-161-1/+1
| | | | In order to avoid unintended implicit conversions.
* Flush CValidationInterface callbacks prior to destructionMatt Corallo2017-07-071-0/+4
| | | | | | | Note that the CScheduler thread cant be running at this point, it has already been stopped with the rest of the init threadgroup. Thus, just calling any remaining loose callbacks during Shutdown() is sane.
* Support more than one CScheduler thread for serial clientsMatt Corallo2017-07-071-8/+14
| | | | | | | | | | This will be used by CValidationInterface soon. This requires a bit of work as we need to ensure that most of our callbacks happen in-order (to avoid synchronization issues in wallet) - we keep our own internal queue and push things onto it, scheduling a queue-draining function immediately upon new callbacks.
* Give CMainSignals a reference to the global schedulerMatt Corallo2017-07-071-0/+13
| | | | ...so that it can run some signals in the background later
* Make ValidationInterface signals-type-agnosticMatt Corallo2017-07-031-27/+81
| | | | | | | | | | (by hiding boost::signals stuff in the .cpp) This allows us to give it a bit more intelligence as we move forward, including routing some signals through CScheduler. While the introduction of a "internals" pointer in the class is pretty ugly, the fact that we no longer need to include boost/signals directly from validationinterface.h is very much worth the loss.
* rpc: Move the `generate` RPC call to rpcwalletWladimir J. van der Laan2017-06-291-3/+0
| | | | | | | | | | | This makes it possible to mine to any wallet when multi-wallet mode is added. Solves the same problem as #10649, but IMO in a cleaner way. It also gets rid of the circuitous `ScriptForMining` method on `CValidationInterface`, which really doesn't belong there. After this change it's still possible to mine without wallet through `generatetoaddress`.
* Remove CValidationInterface::UpdatedTransactionMatt Corallo2017-04-131-3/+0
| | | | | | | | | | | | | | | | | This removes another callback from block connection logic, making it easier to reason about the wallet-RPCs-returns-stale-info issue. UpdatedTransaction was previously used by the GUI to display coinbase transactions only after they have a block built on top of them. This worked fine for in most cases, but only worked due to a corner case if the user received a coinbase payout in a block immediately prior to restart. In that case, the normal process of caching the most recent coinbase transaction's hash would not work, and instead it would only work because of the on-load -checkblocks calling DisconnectBlock and ConnectBlock on the current tip. In order to make this more robust, a full mapWallet loop after the first block which is connected after restart was added.
* Remove dead-code tracking of requests for blocks we generatedMatt Corallo2017-04-071-3/+0
|
* SyncTransaction->TxAddedToMempool/BlockConnected/DisconnectedMatt Corallo2017-04-071-3/+9
| | | | | | | | | | | | | | | | | | | | | | | This simplifies fixing the wallet-returns-stale-info issue as we can now hold cs_wallet across an entire block instead of only per-tx (though we only actually do so in the next commit). This change also removes the NOT_IN_BLOCK constant in favor of only passing the CBlockIndex* parameter to SyncTransactions when a new block is being connected, instead of also when a block is being disconnected. This change adds a parameter to BlockConnectedDisconnected which lists the transactions which were removed from mempool due to confliction as a result of this operation. While its somewhat of a shame to make block-validation-logic generate a list of mempool changes to be included in its generated callbacks, fixing this isnt too hard. Further in this change-set, CValidationInterface starts listening to mempool directly, placing it in the middle and giving it a bit of logic to know how to route notifications from block-validation, mempool, etc (though not listening for conflicted-removals yet).
* Add a CValidationInterface::NewPoWValidBlock callbackMatt Corallo2017-01-051-0/+3
|
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Remove SyncWithWallets wrapper functionMatt Corallo2016-10-041-4/+0
|
* Make validationinterface.UpdatedBlockTip more verboseMatt Corallo2016-10-041-2/+2
| | | | | | In anticipation of making all the callbacks out of block processing flow through it. Note that vHashes will always have something in it since pindexFork != pindexNewTip.
* net: Pass CConnection to wallet rather than using the globalCory Fields2016-09-081-2/+2
|
* Reduce cs_main locks during ConnectTip/SyncWithWalletsJonas Schnelli2016-08-121-2/+2
|
* include the chaintip *blockIndex in the SyncTransaction signalJonas Schnelli2015-12-041-4/+4
| | | | | - allows reducing of calls to main.cpp for getting the chaintip during transaction syncing - potentially allows reducing of cs_main locks
* Add ZeroMQ support. Notify blocks and transactions via ZeroMQJeff Garzik2015-09-161-1/+0
| | | | | | | | | Continues Johnathan Corgan's work. Publishing multipart messages Bugfix: Add missing zmq header includes Bugfix: Adjust build system to link ZeroMQ code for Qt binaries
* Add UpdatedBlockTip signal to CMainSignals and CValidationInterfaceJoão Barbosa2015-09-161-0/+4
|
* miner: rename UpdateRequestCount signal to ResetRequestCountJonas Schnelli2015-07-011-2/+2
|
* detach wallet from minerJonas Schnelli2015-06-301-0/+6
|
* Remove unused code from wallet and validation interfaceMichael Ford2015-05-181-3/+0
| | | | Fixes #6109
* Regression test for ResendWalletTransactionsGavin Andresen2015-03-241-2/+2
| | | | | | | | | | | | | | | | Adds a regression test for the wallet's ResendWalletTransactions function, which uses a new, hidden RPC command "resendwallettransactions." I refactored main's Broadcast signal so it is passed the best-block time, which let me remove a global variable shared between main.cpp and the wallet (nTimeBestReceived). I also manually tested the "rebroadcast unconfirmed every half hour or so" functionality by: 1. Running bitcoind -connect=0.0.0.0:8333 2. Creating a couple of send-to-self transactions 3. Connect to a peer using -addnode 4. Waited a while, monitoring debug.log, until I see: ```2015-03-23 18:48:10 ResendWalletTransactions: rebroadcast 2 unconfirmed transactions``` One last change: don't bother putting ResendWalletTransactions messages in debug.log unless unconfirmed transactions were actually rebroadcast.
* Includes: Refactor: Move CValidationInterface and CMainSignals out of mainJorge Timón2015-03-241-0/+47