[Bugfix] Fix incorrect disconnect call for static functions
Problem:
When using `uiInterface.NotifyBlockTip.disconnect(BlockNotifyGenesisWait)`
to disconnect a static function, the compilation fails because `boost::signals2::disconnect`
requires the exact type signature match of the slot. Using the function name directly
doesn't resolve to the correct function pointer for static functions.
Solution:
The fix explicitly uses `&BlockNotifyGenesisWait` to pass the function pointer.
This resolves the compilation error.
Impact:
Only affects the disconnect mechanism for static functions in `uiInterface.NotifyBlockTip`.
Signed-off-by: Dongyan Qian <dongyan0314@gmail.com>
This reverses the order in which the auxpow structure and the PoW on it
are verified. By checking the PoW first, we make it harder for random
nodes to pass data of their choosing into CAuxPow::check.
Cherry-picked from: namecoin/namecoin-core@b6e3241b
Conflicts resolved:
- CAuxPow member name mismatch
- source code from validation.cpp resides in dogecoin.cpp
Replaces assert() calls with if() statements returning functional
failure that can be handled for situations that can be triggered
from outside of compiled code - i.e. peers.
Backported from: 42bd4c74
Original Author: dergoegge <n.goeggi@gmail.com>
the .99 makes sure that code in master is never mistaken for
release code, and is always a higher version than the last minor
release
Also set the last release date to match 1.14.8 instead of 1.14.7
Maintaining up to 100000 INVs per peer is excessive. A Dogecoin
Core node will never send more than 7 invs per second.
Backported from: de11b0a4
Original Author: Pieter Wuille <pieter@wuille.net>
The major changes are:
* Announcements from outbound (and whitelisted) peers are now
always preferred over those from inbound peers. This used to be
the case for the first request (by delaying the first request
from inbound peers), and a bias after. The 2s delay for requests
from inbound peers still exists, but after that, if viable
outbound peers remain for any given transaction, they will
always be tried first.
* No more hard cap of 100 in flight transactions per peer, as
there is less need for it (memory usage is linear in the number
of announcements, but independent from the number in flight,
and CPU usage isn't affected by it). Furthermore, if only one
peer announces a transaction, and it has over 100 in flight and
requestable already, we still want to request it from them. The
cap is replaced with an additional 2s delay (possibly combined
with the existing 2s delays for inbound connections).
Backported from: 242d1647
173a1d2d
Original Author: Pieter Wuille <pieter@wuille.net>
Conflicts:
- replaced GenTx with uint256 because no segwit
- removed additional 2s penalty for non-segwit peers
- used int64_t instead of std::chrono::microseconds per utiltime
- implemented TxRequest as g_txrequest instead of as a member of
PeerManager, which we don't have
- removed the Dogecoin-specific strict max inflight test
- make exceptions for whitelisted nodes as there is no fine-
grained permission system
This adds a new module that defines TxRequestTracker, a data
structure that maintains all information about transaction
requests, and coordinates requests.
Backported from: da3b8fde
3c7fe0e5
fd9a0060
Original Author: Pieter Wuille <pieter@wuille.net>
Conflicts:
- replaced GenTx with uint256 because no segwit
- used int64_t instead of std::chrono::microseconds per utiltime
- removed wtxid tests
Currently difficulty adjustment violations are not reported for
chains that branch off before the last checkpoint. Change this
by moving the checkpoint check after the difficulty check.
Backported from: 85c82b50
Original Author: Pieter Wuille <pieter.wuille@gmail.com>
This makes orphan processing work like handling getdata messages:
After every actual transaction validation attempt, interrupt
processing to deal with messages arriving from other peers.
Cherry-picked from: 866c8058a
Reduces complexity in processing of orphans when receiving tx
messages over p2p. and isolate the functionality in its own
function ProcessOrphanTx
Backported from: 9453018f
6e051f3d
Original Author: Pieter Wuille <pieter.wuille@gmail.com>
Headers-first is the primary method of announcement on the network.
If a node fell back sending blocks by inv, it's probably for a
re-org. The final block hash provided should be the highest, so
send a getheaders and then fetch the blocks we need to catch up.
Backported from: 74673663
Original Author: John Newbery <john@johnnewbery.com>
In boost 1.74.0, boost::filesystem adapted path::copy_option enum
to be the same as the enum in the fs::path from c++17, which is
now called copy_options, and its member "overwrite_if_exists"
is now called "overwrite_existing". In boost 1.85, the deprecated
copy_option enum is fully removed.
Because Dogecoin Core currently supports boost 1.60 and up,
conditionally implement the new enum based on the boost version
that is built against.
fs::basename() and fs::extension() have been removed in boost 1.85,
use path::stem() and path::extension() instead. This is safe since
boost 1.44 (boost::filesystem version 3), and the minimum supported
boost version for Dogecoin Core is 1.60.
path::is_complete() has been deprecated since boost::filesystem
version 3, which was introduced with boost 1.44.0, and removed in
1.85.0. The minimum supported boost version has been 1.60.0 since
Dogecoin Core release v1.14.3, so this can be safely replaced.
random_shuffle is deprecated since c++11 and removed in c++17. Use
the shuffle function instead, now that we have a standardized
interface available on FastRandomContext.
This enables c++17 compilation
This makes it possible to plug it into the various standard C++11 random
distribution algorithms and other functions like std::shuffle.
Cherry-picked from: 1ec1602a4549f6b68586cead8eff701bceb624f5
-add msvc ssize_t definition in compat.h
-change NUM_OS_RANDOM_BYTES to int from ssize_t in random.h
Includes squashed commit: f7dc99244c8e78dbd0196f612690efcc449c37dc
Inspired by: fbf327b13868861c2877c5754caf5a9816f2603c
change sys/random.h to random.h in AC_MSG_CHECK
remove definitions that are applicable to macos which include unistd.h
additionally change comparator argument from NULL to nullptr when evaluating &getentropy
Inspired by: c13c97dbf846cf0e6a5581ac414ef96a215b0dc6