Skip to content

Commit

Permalink
Merge #2678: [Backport] 5.4.0 backports
Browse files Browse the repository at this point in the history
c9b1909 [net] Remove assert(nMaxInbound > 0) (MarcoFalke)
d629df0 [Refactor] Add ReloadMapSeen function to reload "seen" votes (random-zebra)
7427d44 test: add coverage for the incremental budget sync flow. (furszy)
241627c Budget incremental sync: do not clear seen maps when relay status is reset. (furszy)
61477a5 [Refactor] Budget: check mn-enabled/vote-time before adding to mapSeen (random-zebra)
318fc7c Budget: limit orphan votes maps to 10k entries max. (furszy)
55f3ef9 [Refactor] Simplify CBudgetManager::CheckOrphanVotes() Github-Pull: #2659 Rebased-From: d04f5be (random-zebra)
e5ad197 Budget: Decouple the all-in-one `Budget::Sync()` into two functions: (1) single items sync requests and (2) full budget sync requests. (furszy)
5fd74e4 tiertwo sync: fix orphans votes maps linking single prop/bud hash to a single vote, discarding the previous stored item every time that a new orphan arrives. Blocking any follow-up reception of the orphan votes that were discarded, prohibiting its connection forever. (furszy)
4cdb587 test: add coverage for single proposal sync based on an orphan proposal vote reception and single finalization sync based on an orphan finalization vote. (furszy)
979bb2c budget: generalize budget full sync items relay. (furszy)
736363d Budget sync: Remove useless extra item sync p2p msgs roundtrip (no need to broadcast an inv if the peer is asking for the item directly..) and stop walking through the two maps (budgets and proposals), locking their mutexes, when the peer is requesting a single proposal/budfin. (furszy)
fe6fe56 Tiertwo: do not block peers if they requested a single proposal or single budget finalization. (furszy)
ebbef96 masternodesync: connect the not-connected ProcessSyncStatusMsg. (furszy)
281c061 masternodesync: fix extra `RequestedMNAttempt` increment in the sporks flow. (furszy)
d95fb9b masternodesync: decrease mnw sync threshold to 4 peers. (furszy)
cfc15b6 masternodesync: reset last budget item time before start syncing it. (furszy)
94f1c52 masternodesync: re-format peer version check. (furszy)
946444e Fix ignoring tx data requests when fPauseSend is set on a peer (Matt Corallo)
10cedd0 GUI governance: add missing strings to the translations process. (furszy)
dc10e17 GUI governance: fix proposal name and URL size limit validation. (furszy)
594acc6 [GUI] Fix governance nav button hover css (Fuzzbawls)
fd8d844 GUI: governance, IBD check before opening the proposal creation wizard. (furszy)
33f5dd8 [GUI] Fix proposal tooltip menu location skewing (Fuzzbawls)
55619cc GUI: Differentiate Budget payment transaction records from MNs block reward records. (furszy)
139596e Refactor: Move MN block reward to chainparams. (furszy)
1a55752 GUI: Fix remaining item naming conflicts (Fuzzbawls)
5925150 GUI: Use sorted layout/spacer names in governance UIs (Fuzzbawls)
dfeb3c7 [GUI] Don't show UTXO locking options for shield notes (Fuzzbawls)
6dd96b9 [BUG] GUI: invalid locking of shield notes in coin control Github-Pull: #2661 Rebased-From: d281cde (random-zebra)
1d7f86e Refactor: remove circ depend. primitives/transaction <-> script/standard (random-zebra)
cb3a5b4 Refactor: remove circ dependency checkpoints <-> chainparams (random-zebra)
e02e70e Refactor: remove circ dependency checkpoints <-> validation (random-zebra)
e1a5d0a Break circular dependency: init -> * -> init by extracting shutdown.h (random-zebra)
2d29c42 Cleanup: remove unused init.h includes Github-Pull: #2646 Rebased-From: b09422f (random-zebra)
95c7f2e cleanup: fix header includes sorting and copy Github-Pull: #2642 Rebased-From: 525c2e7 (random-zebra)
fdd4045 scripted-diff: replace boost::optional with Optional<> wrapper (random-zebra)

Pull request description:

  List of PRs included:

  * #2642
  * #2646
  * #2643
  * #2644
  * #2661
  * #2662
  * #2663
  * #2671
  * #2664
  * #2670
  * #2665
  * #2672
  * #2659
  * #2677
  * #2682

ACKs for top commit:
  random-zebra:
    ACK c9b1909
  Fuzzbawls:
    ACK c9b1909

Tree-SHA512: 34871cd7d527302ec6bd3924f4ca4322116952c8b69317831b2652165fbf1c566f893dace9a2998823c6781c4e578c2eeb9bc367fa39f632235aee7f45a68306
  • Loading branch information
furszy committed Dec 15, 2021
2 parents 08c6da7 + c9b1909 commit 0706a79
Show file tree
Hide file tree
Showing 81 changed files with 825 additions and 548 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ set(SERVER_SOURCES
./src/rpc/server.cpp
./src/script/sigcache.cpp
./src/script/ismine.cpp
./src/shutdown.cpp
./src/sporkdb.cpp
./src/timedata.cpp
./src/torcontrol.cpp
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ BITCOIN_CORE_H = \
script/standard.h \
script/script_error.h \
serialize.h \
shutdown.h \
span.h \
spork.h \
sporkdb.h \
Expand Down Expand Up @@ -374,6 +375,7 @@ libbitcoin_server_a_SOURCES = \
rpc/server.cpp \
script/sigcache.cpp \
script/ismine.cpp \
shutdown.cpp \
sporkdb.cpp \
timedata.cpp \
torcontrol.cpp \
Expand Down
23 changes: 20 additions & 3 deletions src/blocksignature.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2017-2020 The PIVX developers
// Copyright (c) 2017-2021 The PIVX developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

Expand All @@ -7,6 +7,23 @@
#include "script/standard.h"
#include "zpivchain.h"

static bool GetKeyIDFromUTXO(const CTxOut& utxo, CKeyID& keyIDRet)
{
std::vector<valtype> vSolutions;
txnouttype whichType;
if (utxo.scriptPubKey.empty() || !Solver(utxo.scriptPubKey, whichType, vSolutions))
return false;
if (whichType == TX_PUBKEY) {
keyIDRet = CPubKey(vSolutions[0]).GetID();
return true;
}
if (whichType == TX_PUBKEYHASH || whichType == TX_COLDSTAKE) {
keyIDRet = CKeyID(uint160(vSolutions[0]));
return true;
}
return false;
}

bool SignBlockWithKey(CBlock& block, const CKey& key)
{
if (!key.Sign(block.GetHash(), block.vchBlockSig))
Expand All @@ -21,15 +38,15 @@ bool SignBlock(CBlock& block, const CKeyStore& keystore)
if (block.IsProofOfWork()) {
bool fFoundID = false;
for (const CTxOut& txout : block.vtx[0]->vout) {
if (!txout.GetKeyIDFromUTXO(keyID))
if (!GetKeyIDFromUTXO(txout, keyID))
continue;
fFoundID = true;
break;
}
if (!fFoundID)
return error("%s: failed to find key for PoW", __func__);
} else {
if (!block.vtx[1]->vout[1].GetKeyIDFromUTXO(keyID))
if (!GetKeyIDFromUTXO(block.vtx[1]->vout[1], keyID))
return error("%s: failed to find key for PoS", __func__);
}

Expand Down
Loading

0 comments on commit 0706a79

Please sign in to comment.