mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Temporarily fix build error cased by out-of-order backporting
Can be removed when we catch up with backporting. You'll notice it's time for this when you get conflicts while merging the affected backported PR.
This commit is contained in:
parent
808936cc30
commit
36aa554584
@ -520,6 +520,21 @@ void UnregisterNodeSignals(CNodeSignals& nodeSignals)
|
||||
// mapOrphanTransactions
|
||||
//
|
||||
|
||||
// TODO This is a temporary solution while backporting Bitcoin 0.13 changes into Dash
|
||||
// See caller of this method
|
||||
void LoopMapOrphanTransactionsByPrev(const CTransaction &tx, std::vector<uint256> &vOrphanErase)
|
||||
{
|
||||
for (size_t j = 0; j < tx.vin.size(); j++) {
|
||||
auto itByPrev = mapOrphanTransactionsByPrev.find(tx.vin[j].prevout);
|
||||
if (itByPrev == mapOrphanTransactionsByPrev.end()) continue;
|
||||
for (auto mi = itByPrev->second.begin(); mi != itByPrev->second.end(); ++mi) {
|
||||
const CTransaction& orphanTx = (*mi)->second.tx;
|
||||
const uint256& orphanHash = orphanTx.GetHash();
|
||||
vOrphanErase.push_back(orphanHash);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool AddOrphanTx(const CTransaction& tx, NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
|
||||
{
|
||||
uint256 hash = tx.GetHash();
|
||||
@ -551,7 +566,7 @@ bool AddOrphanTx(const CTransaction& tx, NodeId peer) EXCLUSIVE_LOCKS_REQUIRED(c
|
||||
return true;
|
||||
}
|
||||
|
||||
int static EraseOrphanTx(uint256 hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
|
||||
int EraseOrphanTx(uint256 hash) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
|
||||
{
|
||||
map<uint256, COrphanTx>::iterator it = mapOrphanTransactions.find(hash);
|
||||
if (it == mapOrphanTransactions.end())
|
||||
|
@ -102,6 +102,10 @@ CTxMemPool mempool(::minRelayTxFee);
|
||||
FeeFilterRounder filterRounder(::minRelayTxFee);
|
||||
map<uint256, int64_t> mapRejectedBlocks GUARDED_BY(cs_main);
|
||||
|
||||
// TODO temporary hack for backporting
|
||||
void LoopMapOrphanTransactionsByPrev(const CTransaction &tx, std::vector<uint256> &vOrphanErase);
|
||||
int EraseOrphanTx(uint256 hash);
|
||||
|
||||
/**
|
||||
* Returns true if there are nRequired or more blocks of minVersion or above
|
||||
* in the last Consensus::Params::nMajorityWindow blocks, starting at pstart and going backwards.
|
||||
@ -2119,15 +2123,20 @@ static bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockInd
|
||||
}
|
||||
|
||||
// Which orphan pool entries must we evict?
|
||||
for (size_t j = 0; j < tx.vin.size(); j++) {
|
||||
auto itByPrev = mapOrphanTransactionsByPrev.find(tx.vin[j].prevout);
|
||||
if (itByPrev == mapOrphanTransactionsByPrev.end()) continue;
|
||||
for (auto mi = itByPrev->second.begin(); mi != itByPrev->second.end(); ++mi) {
|
||||
const CTransaction& orphanTx = (*mi)->second.tx;
|
||||
const uint256& orphanHash = orphanTx.GetHash();
|
||||
vOrphanErase.push_back(orphanHash);
|
||||
}
|
||||
}
|
||||
//for (size_t j = 0; j < tx.vin.size(); j++) {
|
||||
// auto itByPrev = mapOrphanTransactionsByPrev.find(tx.vin[j].prevout);
|
||||
// if (itByPrev == mapOrphanTransactionsByPrev.end()) continue;
|
||||
// for (auto mi = itByPrev->second.begin(); mi != itByPrev->second.end(); ++mi) {
|
||||
// const CTransaction& orphanTx = (*mi)->second.tx;
|
||||
// const uint256& orphanHash = orphanTx.GetHash();
|
||||
// vOrphanErase.push_back(orphanHash);
|
||||
// }
|
||||
//}
|
||||
// TODO This is a temporary solution while backporting Bitcoin 0.13 changes into Dash
|
||||
// It is needed because the splitting of main.cpp into validation.cpp/net_processing.cpp was done out of order
|
||||
// When we catch up with backporting, the above loop will be at the correct place in net_processing.cpp
|
||||
// and this hack can be removed
|
||||
LoopMapOrphanTransactionsByPrev(tx, vOrphanErase);
|
||||
|
||||
if (!SequenceLocks(tx, nLockTimeFlags, &prevheights, *pindex)) {
|
||||
return state.DoS(100, error("%s: contains a non-BIP68-final transaction", __func__),
|
||||
|
Loading…
Reference in New Issue
Block a user