Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #340 and DropAfterBlockBySha/NewestSha bug. #357

Merged
merged 1 commit into from
Mar 30, 2015

Conversation

aakselrod
Copy link
Contributor

  • Delete spent TX in setclearSpentData when unspent by block
    disconnect on reorg.
  • Test spent TX deletion when reorg causes block disconnect.
  • Test for correct NewestSha results after DropAfterBlockBySha.
  • Fix DropAfterBlockBySha to update info for NewestSha.

@@ -0,0 +1,182 @@
// Copyright (c) 2013-2014 Conformal Systems LLC.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New file. This should be 2015.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops. Will fix that.

@aakselrod aakselrod force-pushed the reorg-fixes branch 2 times, most recently from d6e5d56 to 055bfc2 Compare March 27, 2015 18:22
@davecgh
Copy link
Member

davecgh commented Mar 30, 2015

@aakselrod Thanks for hunting this down and getting it fixed. Looks good.

OK

if rintbuf != uint32(network) {
break
}
err = binary.Read(dr, binary.LittleEndian, &rintbuf)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error isn't checked

@jrick
Copy link
Member

jrick commented Mar 30, 2015

Fix looks correct but I added some suggestions for the test code.

@aakselrod
Copy link
Contributor Author

Updated test code to comply with @jrick's suggestions.

spentTxList = spentTxList[:len(spentTxList)-1]
// XXX format sTxList and set update Table
// This code should never be hit - aakselrod
return fmt.Errorf(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Argument syntax formatting here doesn't match the rest of the code base.

- Delete spent TX in setclearSpentData when unspent by block
  disconnect on reorg; return an error when there's more than
  one record to delete in the spent TX as that should never
  happen.

- Test spent TX deletion when reorg causes block disconnect.

- Test for correct NewestSha results after DropAfterBlockBySha.

- Fix DropAfterBlockBySha to update info for NewestSha.

- Updated copyright statements in modified files
@davecgh
Copy link
Member

davecgh commented Mar 30, 2015

All set. Round 2 OK.

@jrick
Copy link
Member

jrick commented Mar 30, 2015

ok

@conformal-deploy conformal-deploy merged commit 9199847 into btcsuite:master Mar 30, 2015
@aakselrod aakselrod deleted the reorg-fixes branch March 30, 2015 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants