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

Fixes pool.getBroadcasted() error item.hash is not a function #598

Merged
merged 1 commit into from
Aug 31, 2018

Conversation

pinheadmz
Copy link
Member

@pinheadmz pinheadmz commented Aug 30, 2018

This issue was uncovered by @OrfeasLitos in progress of writing this guide, in which an error is thrown when a peer requests a transaction from the inventory:

[D:2018-08-27T19:15:36Z] (net) Error: item.hash is not a function (127.0.0.1:55362)

The bug was introduced 20 days ago in a0ac953 and prevents all transaction broadcasting to peers!

Thanks to @tuxcanfly for finding the bug and checking for other occurrences (none found yet!)

Test is a little funny but it's the only way I could figure to hit that exact line.

@codecov-io

This comment has been minimized.

@OrfeasLitos
Copy link
Contributor

Sounds like a pretty important bug. Weird that it slipped through all tests. Thanks!

});
const txItem = new InvItem(invTypes.TX, tx1.hash());
await node.sendTX(tx1); // add TX to inventory
node.pool.getBroadcasted(dummyPeer, txItem);
Copy link
Member

Choose a reason for hiding this comment

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

Could use an assert on returned tx vs tx2.id().

@pinheadmz
Copy link
Member Author

updated and squashed

@tuxcanfly tuxcanfly merged commit 15b024a into bcoin-org:master Aug 31, 2018
@braydonf braydonf added this to the 2.0.0 milestone Jan 6, 2020
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.

5 participants