Fix remove support bug #53
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
hard fork
help wanted
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
soft fork
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
work in progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbrycrd#53
Loading…
Reference in a new issue
No description provided.
Delete branch "fix_removesupport_bug_2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is a redo of https://github.com/lbryio/lbrycrd/pull/45, containing only the fix and not the test which is contained in https://github.com/lbryio/lbrycrd/pull/52
Fixing below exception that would occurs, when decrementing block and calling function "removeSupportFromMap" to undo a support which has been spent on a txin that is NOT txin[0]
lbrycrdd: claimtrie.cpp:2294: bool CClaimTrieCache::decrementBlock(insertUndoType&, claimQueueRowType&, insertUndoType&, supportQueueRowType&, std::vectorstd::pair<std::basic_string<char, int> >&) const: Assertion `removeSupportFromMap(itSupportUndo->name, itSupportUndo->outPoint, support, false)' failed.
Essentially, the bug caused spent supports to not be undoable. Thus when decrementing a block where a support is spent, the support would still be spent when it should be unspent. When decrementing the block where that support was created, the removeSupportFromMap function would fail because the support its looking to remove is not there.
With this change, clients must run -reindex once to fix the claimtrie.
To verify the patch is working, running ./lbrycrd-cli verifychain 4 0 , should not cause an exception and return true. If not patched, running the command, will cause lbrycrdd to throw the above exception.
nit:
remover
should beremoved
one type, otherwise LGTM
Fixed spelling mistake, rebased , and merged