mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 20:42:59 +01:00
Chain::SetTip return type to void
This commit is contained in:
parent
84d13eef88
commit
b7ae2c172a
@ -9,17 +9,16 @@ using namespace std;
|
|||||||
|
|
||||||
// CChain implementation
|
// CChain implementation
|
||||||
|
|
||||||
CBlockIndex *CChain::SetTip(CBlockIndex *pindex) {
|
void CChain::SetTip(CBlockIndex *pindex) {
|
||||||
if (pindex == NULL) {
|
if (pindex == NULL) {
|
||||||
vChain.clear();
|
vChain.clear();
|
||||||
return NULL;
|
return;
|
||||||
}
|
}
|
||||||
vChain.resize(pindex->nHeight + 1);
|
vChain.resize(pindex->nHeight + 1);
|
||||||
while (pindex && vChain[pindex->nHeight] != pindex) {
|
while (pindex && vChain[pindex->nHeight] != pindex) {
|
||||||
vChain[pindex->nHeight] = pindex;
|
vChain[pindex->nHeight] = pindex;
|
||||||
pindex = pindex->pprev;
|
pindex = pindex->pprev;
|
||||||
}
|
}
|
||||||
return pindex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const {
|
CBlockLocator CChain::GetLocator(const CBlockIndex *pindex) const {
|
||||||
|
@ -395,8 +395,8 @@ public:
|
|||||||
return vChain.size() - 1;
|
return vChain.size() - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Set/initialize a chain with a given tip. Returns the forking point. */
|
/** Set/initialize a chain with a given tip. */
|
||||||
CBlockIndex *SetTip(CBlockIndex *pindex);
|
void SetTip(CBlockIndex *pindex);
|
||||||
|
|
||||||
/** Return a CBlockLocator that refers to a block in this chain (by default the tip). */
|
/** Return a CBlockLocator that refers to a block in this chain (by default the tip). */
|
||||||
CBlockLocator GetLocator(const CBlockIndex *pindex = NULL) const;
|
CBlockLocator GetLocator(const CBlockIndex *pindex = NULL) const;
|
||||||
|
Loading…
Reference in New Issue
Block a user