-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
chainntnfs: fix nil pointer on address reuse #3569
chainntnfs: fix nil pointer on address reuse #3569
Conversation
865505b
to
f6ded12
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps the better fix here is to ignore the reuse when detecting it within a transaction? This currently prevents the panic, but a notification won't be dispatched for the reuse anyway.
5fbd2d6
to
ac754ab
Compare
I now implemented the version that will not notify again on reuse. The unit test setup is still a bit peculiar with the event listener in the goroutine since we still get multiple messages on the Not sure if this can still cause problems on the receiver end? |
I think we can get around this by adding an additional check to ensure no details exist for the notification before notifying the transaction at: Line 1494 in 6765b86
|
ac754ab
to
bb56b8f
Compare
I was able to get around the problem by not notifying |
bb56b8f
to
a682458
Compare
Ok, I think I was finally able to fix it the way you suggested, @wpaulino. |
9f1a905
to
f39df06
Compare
Travis is reporting a linter failure: |
f39df06
to
b040c6d
Compare
b040c6d
to
ec44181
Compare
ec44181
to
d54d592
Compare
d54d592
to
fa948c2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM ✅
When a confirmation notification for a script hash is registered, the notifier panics with a nil pointer dereference in case two transactions send funds to this script and are confirmed at different block heights.
The test that triggers the panic is added in the first commit with a fix for it in the second commit.