Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
lbry
lbrycrd
Commits
30a517dc
Commit
30a517dc
authored
Dec 05, 2018
by
kay kurokawa
Committed by
Kay Kurokawa
Dec 06, 2018
Browse files
Fix for
https://github.com/lbryio/lbrycrd/issues/243
parent
8b3f2e8b
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/claimtrie.cpp
View file @
30a517dc
...
...
@@ -2235,7 +2235,7 @@ bool CClaimTrieCache::incrementBlock(insertUndoType& insertUndo, claimQueueRowTy
}
if
(
takeoverHappened
)
{
// Get all
claims in the queue for that name
// Get all
pending claims for that name and activate them all in the case that our winner is defunct.
queueNameType
::
iterator
itQueueNameRow
=
getQueueCacheNameRow
(
*
itNamesToCheck
,
false
);
if
(
itQueueNameRow
!=
claimQueueNameCache
.
end
())
{
...
...
@@ -2366,6 +2366,9 @@ bool CClaimTrieCache::decrementBlock(insertUndoType& insertUndo, claimQueueRowTy
supportQueueType
::
iterator
itSupportRow
=
getSupportQueueCacheRow
(
itSupportUndo
->
nHeight
,
true
);
CSupportValue
support
;
assert
(
removeSupportFromMap
(
itSupportUndo
->
name
,
itSupportUndo
->
outPoint
,
support
,
false
));
// support.nValidHeight may have been changed if this was inserted before activation height
// due to a triggered takeover, change it back to original nValidAtHeight
support
.
nValidAtHeight
=
itSupportUndo
->
nHeight
;
queueNameType
::
iterator
itSupportNameRow
=
getSupportQueueCacheNameRow
(
itSupportUndo
->
name
,
true
);
itSupportRow
->
second
.
push_back
(
std
::
make_pair
(
itSupportUndo
->
name
,
support
));
itSupportNameRow
->
second
.
push_back
(
outPointHeightType
(
support
.
outPoint
,
support
.
nValidAtHeight
));
...
...
@@ -2386,11 +2389,15 @@ bool CClaimTrieCache::decrementBlock(insertUndoType& insertUndo, claimQueueRowTy
for
(
insertUndoType
::
iterator
itInsertUndo
=
insertUndo
.
begin
();
itInsertUndo
!=
insertUndo
.
end
();
++
itInsertUndo
)
{
claimQueueType
::
iterator
itQueueRow
=
getQueueCacheRow
(
itInsertUndo
->
nHeight
,
true
);
CClaimValue
claim
;
assert
(
removeClaimFromTrie
(
itInsertUndo
->
name
,
itInsertUndo
->
outPoint
,
claim
,
false
));
// claim.nValidHeight may have been changed if this was inserted before activation height
// due to a triggered takeover, change it back to original nValidAtHeight
claim
.
nValidAtHeight
=
itInsertUndo
->
nHeight
;
queueNameType
::
iterator
itQueueNameRow
=
getQueueCacheNameRow
(
itInsertUndo
->
name
,
true
);
itQueueRow
->
second
.
push_back
(
std
::
make_pair
(
itInsertUndo
->
name
,
claim
));
itQueueNameRow
->
second
.
push_back
(
outPointHeightType
(
itInsertUndo
->
outPoint
,
itInsertUndo
->
n
Height
));
itQueueNameRow
->
second
.
push_back
(
outPointHeightType
(
itInsertUndo
->
outPoint
,
claim
.
nValidAt
Height
));
}
for
(
std
::
vector
<
std
::
pair
<
std
::
string
,
int
>
>::
iterator
itTakeoverHeightUndo
=
takeoverHeightUndo
.
begin
();
itTakeoverHeightUndo
!=
takeoverHeightUndo
.
end
();
++
itTakeoverHeightUndo
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment