Age | Commit message (Collapse) | Author |
|
In case the total number of orphan blocks in memory exceeds a limit
(currently set to 750), a random orphan block (which is not
depended on by another orphan block) is dropped. This means it will
need to be downloaded again, but it won't consume memory until then.
|
|
c117d9e Support for error messages and a few more rejection reasons (Luke Dashjr)
14e7ffc Use standard BIP 22 rejection reasons where applicable (Luke Dashjr)
|
|
Prepare block connection logic for headers-first
|
|
|
|
|
|
|
|
This changes the block processing logic from "try to atomically switch
to a new block" to a continuous "(dis)connect a block, aiming for the
assumed best chain".
This means the smallest atomic operations on the chainstate become
individual block connections or disconnections, instead of entire
reorganizations. It may mean that we try to reorganize to one block,
fail, and rereorganize again to the old block. This is slower, but
doesn't require unbounded RAM.
It also means that a ConnectBlock which fails may be no longer called
from the ProcessBlock which knows which node sent it. To deal with that,
a mapBlockSource is kept, and invalid blocks cause asynchronous "reject"
messages and banning (if necessary).
|
|
|
|
Previously CreateNewBlock() didn't take into account the fact that
IsFinalTx() without any arguments tests if the transaction is considered
final in the *current* block, when both those functions really needed to
know if the transaction would be final in the *next* block.
Additionally the UI had a similar misunderstanding.
Also adds some basic tests to check that CreateNewBlock() is in fact
mining nLockTime-using transactions correctly.
Thanks to Wladimir J. van der Laan for rebase.
|
|
After the tinyformat switch sprintf() family functions support passing
actual std::string objects.
Remove unnecessary c_str calls (236 of them) in logging and formatting.
|
|
Switch to tinyformat-based formatting.
Tinyformat is a typesafe drop-in replacement for C99 printf functions:
https://github.com/c42f/tinyformat
|
|
7e08e29 better std::exception logging for block/undo files (Philip Kaufmann)
|
|
|
|
|
|
012ca1c LoadWallet: acquire cs_wallet mutex before clearing setKeyPool (Wladimir J. van der Laan)
9569168 Document cs_wallet lock and add AssertLockHeld (Wladimir J. van der Laan)
19a5676 Use mutex pointer instead of name for AssertLockHeld (Wladimir J. van der Laan)
|
|
This makes it useable for non-global locks such as the wallet and
keystore locks.
|
|
Transaction fee is only used by the wallet.
No need for it to be in main.cpp.
|
|
|
|
There were quite a few places where assert() was used with side effects,
making operation with NDEBUG non-functional. This commit fixes all the
cases I know about, but also adds an #error on NDEBUG because the code
is untested without assertions and may still have vulnerabilities if
used without assert.
|
|
mutex debugging routines: LocksHeld() and AssertLockHeld()
|
|
Also changes mempool to store CTxMemPoolEntries
to keep track of when they enter/exit the pool.
|
|
GetValueIn makes more sense as a CTransaction member.
|
|
This dead code can be resurrected from git history if
transaction replacement is ever implemented. Keeping
dead code in the source is a bad idea, because it implies
it was tested and worked at some point, which is not true.
|
|
|
|
|
|
|
|
relicts from the CTransaction refactor.
|
|
379778b core: remove includes in .cpp, if header is already in .h (Philip Kaufmann)
|
|
- example: if util.h includes stdint.h, remove it from util.cpp, as
util.h is the first header included in util.cpp
|
|
|
|
|
|
Cleanup refactoring of coins/mempool
|
|
|
|
|
|
|
|
Use misc methods of avoiding unnecesary header includes.
Replace int typedefs with int##_t from stdint.h.
Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h.
Normalize QT_VERSION ifs where possible.
Resolve some indirect dependencies as direct ones.
Remove extern declarations from .cpp files.
|
|
Split MIN_PROTO_VERSION into INIT_PROTO_VERSION and MIN_PEER_PROTO_VERSION
|
|
No more specific handling of GUI in bitcoin core.
Replace the last usage of fHaveGUI with a fForceServer
parameter on AppInit2.
|
|
|
|
|
|
caca6aa Make some globals in main non-public. (Pieter Wuille)
85eb2ce Do not use the redundant BestInvalidWork record in the block database. (Pieter Wuille)
|
|
a616206 Give peer time-adjustment data an own lock (Pieter Wuille)
|
|
This means they are declared static, and their extern definition in
main.h is removed. Also moved CBlockIndexWorkComparator to the .cpp
file.
|
|
As block index entries have a flag for marking invalid blocks, the
'best invalid work' information can be derived from there. In addition,
remove the global from main.h
|
|
- re-work -debug help message text
- make -debug log every debugging information again (even all categories)
- remove unneeded fDebug checks in front of LogPrint()/qDebug(), as that
check is done in LogPrintf() when category is != NULL (true for all
LogPrint() calls
- remove fDebug ONLY in code which is NOT performance-critical
- harmonize addrman category name
- deprecate -debugnet usage, should be used via -debug=net and remove the
corresponding global
|
|
Interaction cleanups between main and wallet
|
|
Instead of explicitly testing for the presence of any output, and
dealing with this case specially, just interpret it as an empty
CCoins.
The case previously caught using the HaveCoins check, is now handled
by the generic outs != outsBlock test.
|
|
|
|
This required some code movement (what was CWalletTx::AcceptToMemoryPool
doing in main?), and adding a few explicit includes that used to be
implicit through init.h.
|
|
|