Skip to content

Commit

Permalink
Merge branch 'develop' of https://github.com/dashpay/dash into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Sep 22, 2024
2 parents 4cbe8bd + 89a7c60 commit df96997
Show file tree
Hide file tree
Showing 28 changed files with 888 additions and 571 deletions.
32 changes: 32 additions & 0 deletions contrib/builder-keys/kittywhiskers.pgp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mDMEZZs7ABYJKwYBBAHaRw8BAQdAxvpS5zLLn9agjKg1bpMyHtKROTC8SLTl3AZm
b4DKXJq0P0tpdHR5d2hpc2tlcnMgVmFuIEdvZ2ggPDYzMTg5NTMxK2t3dmdAdXNl
cnMubm9yZXBseS5naXRodWIuY29tPoiaBBMWCABCAhsDBQkDw7iAAheAAhkBFiEE
lpGHqOdP5AqKSAZ0MM0MBl5cSq0FAmbpq2gFCwkIBwIGFQoJCAsCBRYCAwEAAh4F
AAoJEDDNDAZeXEqt6D4BALOgavknWXzg3zyBI4rzqS2Qq1qrDl0AVohpYQYJrUZ6
AP92LejS8DyeR4NZuUeP4gCxL/0wOydz6LkmEefaTvNiD7RIS2l0dHl3aGlza2Vy
cyBWYW4gR29naCA8NjMxODk1MzEra2l0dHl3aGlza2Vyc0B1c2Vycy5ub3JlcGx5
LmdpdGh1Yi5jb20+iJcEExYIAD8CGwMFCQPDuIACF4AWIQSWkYeo50/kCopIBnQw
zQwGXlxKrQUCZumraQULCQgHAgYVCgkICwIFFgIDAQACHgUACgkQMM0MBl5cSq3B
zAD/T6dYqUtzIuZjIIBXisBMISNTHQxRv1KH3txuN+lCW/UBAIMV6Y41aIqbGnI2
ADm+WYFsnABokj+mT5GZBuqfEYQEtEdLaXR0eXdoaXNrZXJzIFZhbiBHb2doIDw2
MDk4OTc0LWtpdHR5d2hpc2tlcnNAdXNlcnMubm9yZXBseS5naXRsYWIuY29tPoiX
BBMWCAA/AhsDBQkDw7iAAheAFiEElpGHqOdP5AqKSAZ0MM0MBl5cSq0FAmbpq2kF
CwkIBwIGFQoJCAsCBRYCAwEAAh4FAAoJEDDNDAZeXEqt2D0BAIZOVRQgvP6DZeXc
ONNZcFGp3mrbumudjsoCCiDTS/PZAP48LFSFBB8NBcXgjj1edktii9AN3JYyW+yF
60uLMN4NAbQvS2l0dHl3aGlza2VycyBWYW4gR29naCA8a2l0dHl3aGlza2Vyc0Bk
YXNoLm9yZz6IlwQTFgoAPwIbAwUJA8O4gAIXgBYhBJaRh6jnT+QKikgGdDDNDAZe
XEqtBQJm6atpBQsJCAcCBhUKCQgLAgUWAgMBAAIeBQAKCRAwzQwGXlxKrSHfAQCU
Tu3DPWNWj8weotN4NKoShfsMrIEEeKqv1ykLc1K2lwD8CwEBUG69Pl8NFWMElvam
6wu9OWtOKp9xBkFS+CjM8A60NktpdHR5d2hpc2tlcnMgVmFuIEdvZ2ggPGt3dmdA
dXNlcnMubm9yZXBseS5naXRodWIuY29tPoiXBBMWCgA/AhsDBQkDw7iAAheAFiEE
lpGHqOdP5AqKSAZ0MM0MBl5cSq0FAmbpq2kFCwkIBwIGFQoJCAsCBRYCAwEAAh4F
AAoJEDDNDAZeXEqt4YAA/22FrVJGDOeZVYRNLjFL34+YjXEyTO5dACjZ8jV2/uHD
AQDB9osQDYr/lDfuMMSPZhufAryHIWBJp/e8AwHwJ65aALg4BGWbOwASCisGAQQB
l1UBBQEBB0DCbqznf45arlTBDkpS76ineVKFabpOa3vohGKIKJ+5FAMBCAeIfgQY
FggAJhYhBJaRh6jnT+QKikgGdDDNDAZeXEqtBQJlmzsAAhsMBQkDw7iAAAoJEDDN
DAZeXEqtUvEBALBrYJ7jRRCwBMBTG2doiFupibGQh2vN46gKSrXzYSG9AQDIXcCJ
moGvMWiiBz71Wr9JZ7/ZV6rcRE1YXfM06G6gCQ==
=gtD4
-----END PGP PUBLIC KEY BLOCK-----
4 changes: 4 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ BITCOIN_CORE_H = \
node/blockstorage.h \
node/coin.h \
node/coinstats.h \
node/connection_types.h \
node/context.h \
node/eviction.h \
node/psbt.h \
node/transaction.h \
node/ui_interface.h \
Expand Down Expand Up @@ -498,7 +500,9 @@ libbitcoin_server_a_SOURCES = \
node/blockstorage.cpp \
node/coin.cpp \
node/coinstats.cpp \
node/connection_types.cpp \
node/context.cpp \
node/eviction.cpp \
node/interfaces.cpp \
node/psbt.cpp \
node/transaction.cpp \
Expand Down
2 changes: 1 addition & 1 deletion src/addrman.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class AddrMan
* @param[in] in_new Select addresses only from one table (true = new, false = tried, nullopt = both)
* @return Number of unique addresses that match specified options.
*/
size_t Size(std::optional<Network> net = {}, std::optional<bool> in_new = {}) const;
size_t Size(std::optional<Network> net = std::nullopt, std::optional<bool> in_new = std::nullopt) const;

/**
* Attempt to add one or more addresses to addrman's new table.
Expand Down
5 changes: 1 addition & 4 deletions src/evo/mnhftx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,7 @@ std::optional<CMNHFManager::Signals> CMNHFManager::ProcessBlock(const CBlock& bl
return signals;
}
for (const auto& versionBit : new_signals) {
if (Params().IsValidMNActivation(versionBit, pindex->GetMedianTimePast())) {
signals.insert({versionBit, mined_height});
}

signals.insert({versionBit, mined_height});
}

AddToCache(signals, pindex);
Expand Down
39 changes: 37 additions & 2 deletions src/masternode/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,42 @@
#include <validation.h>
#include <warnings.h>

namespace {
bool GetLocal(CService& addr, const CNetAddr* paddrPeer)
{
if (!fListen)
return false;

int nBestScore = -1;
{
LOCK(g_maplocalhost_mutex);
int nBestReachability = -1;
for (const auto& entry : mapLocalHost)
{
// For privacy reasons, don't advertise our privacy-network address
// to other networks and don't advertise our other-network address
// to privacy networks.
const Network our_net{entry.first.GetNetwork()};
const Network peers_net{paddrPeer->GetNetwork()};
if (our_net != peers_net &&
(our_net == NET_ONION || our_net == NET_I2P ||
peers_net == NET_ONION || peers_net == NET_I2P)) {
continue;
}
int nScore = entry.second.nScore;
int nReachability = entry.first.GetReachabilityFrom(*paddrPeer);
if (nReachability > nBestReachability || (nReachability == nBestReachability && nScore > nBestScore))
{
addr = CService(entry.first, entry.second.nPort);
nBestReachability = nReachability;
nBestScore = nScore;
}
}
}
return nBestScore >= 0;
}
} // anonymous namespace

CActiveMasternodeManager::CActiveMasternodeManager(const CBLSSecretKey& sk, CConnman& connman, const std::unique_ptr<CDeterministicMNManager>& dmnman) :
m_info(sk, sk.GetPublicKey()),
m_connman{connman},
Expand Down Expand Up @@ -204,8 +240,7 @@ bool CActiveMasternodeManager::GetLocalAddress(CService& addrRet)
auto service = m_info.service;
m_connman.ForEachNodeContinueIf(CConnman::AllNodes, [&](CNode* pnode) {
empty = false;
if (pnode->addr.IsIPv4())
fFoundLocal = GetLocal(service, &pnode->addr) && IsValidNetAddr(service);
if (pnode->addr.IsIPv4()) fFoundLocal = GetLocal(service, *pnode) && IsValidNetAddr(service);
return !fFoundLocal;
});
// nothing and no live connections, can't do anything for now
Expand Down
Loading

0 comments on commit df96997

Please sign in to comment.