Browse Source

Merge pull request #5104

b7ae2c1 Chain::SetTip return type to void (21E14)
0.10
Wladimir J. van der Laan 10 years ago
parent
commit
93cb689e52
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 5
      src/chain.cpp
  2. 4
      src/chain.h

5
src/chain.cpp

@ -9,17 +9,16 @@ using namespace std; @@ -9,17 +9,16 @@ using namespace std;
// CChain implementation
CBlockIndex *CChain::SetTip(CBlockIndex *pindex) {
void CChain::SetTip(CBlockIndex *pindex) {
if (pindex == NULL) {
vChain.clear();
return NULL;
return;
}
vChain.resize(pindex->nHeight + 1);
while (pindex && vChain[pindex->nHeight] != pindex) {
vChain[pindex->nHeight] = pindex;
pindex = pindex->pprev;
}
return pindex;
}
CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const {

4
src/chain.h

@ -395,8 +395,8 @@ public: @@ -395,8 +395,8 @@ public:
return vChain.size() - 1;
}
/** Set/initialize a chain with a given tip. Returns the forking point. */
CBlockIndex *SetTip(CBlockIndex *pindex);
/** Set/initialize a chain with a given tip. */
void SetTip(CBlockIndex *pindex);
/** Return a CBlockLocator that refers to a block in this chain (by default the tip). */
CBlockLocator GetLocator(const CBlockIndex *pindex = NULL) const;

Loading…
Cancel
Save