@@ -43,7 +43,13 @@ uint64_t CBlockHeaderAndShortTxIDs::GetShortID(const uint256& txhash) const {
4343 return SipHashUint256 (shorttxidk0, shorttxidk1, txhash) & 0xffffffffffffL ;
4444}
4545
46-
46+ std::vector<CTransactionRef> PartiallyDownloadedBlock::GetAvailableTx () {
47+ std::vector<CTransactionRef> found_tx;
48+ for (unsigned int i = 0 ; i < txn_available.size (); i++) {
49+ if (txn_available[i]) found_tx.push_back (txn_available[i]);
50+ }
51+ return found_tx;
52+ }
4753
4854ReadStatus PartiallyDownloadedBlock::InitData (const CBlockHeaderAndShortTxIDs& cmpctblock, const std::vector<std::pair<uint256, CTransactionRef>>& extra_txn) {
4955 if (cmpctblock.header .IsNull () || (cmpctblock.shorttxids .empty () && cmpctblock.prefilledtxn .empty ()))
@@ -173,7 +179,7 @@ bool PartiallyDownloadedBlock::IsTxAvailable(size_t index) const {
173179 return txn_available[index] != nullptr ;
174180}
175181
176- ReadStatus PartiallyDownloadedBlock::FillBlock (CBlock& block, const std::vector<CTransactionRef>& vtx_missing) {
182+ ReadStatus PartiallyDownloadedBlock::FillBlock (CBlock& block, const std::vector<CTransactionRef>& vtx_missing, bool check_pow ) {
177183 assert (!header.IsNull ());
178184 uint256 hash = header.GetHash ();
179185 block = header;
@@ -197,7 +203,7 @@ ReadStatus PartiallyDownloadedBlock::FillBlock(CBlock& block, const std::vector<
197203 return READ_STATUS_INVALID ;
198204
199205 CValidationState state;
200- if (!CheckBlock (block, state, Params ().GetConsensus ())) {
206+ if (!CheckBlock (block, state, Params ().GetConsensus (), check_pow )) {
201207 // TODO: We really want to just check merkle tree manually here,
202208 // but that is expensive, and CheckBlock caches a block's
203209 // "checked-status" (in the CBlock?). CBlock should be able to
0 commit comments