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

Update mempool example to v6.x #389

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

caike
Copy link
Contributor

@caike caike commented Jun 3, 2024

Update local-tx-monitor example

Comment on lines +114 to 117
const message = JSON.parse(e);
if (message?.result?.transaction === null) {
rpc('acquireMempool');
} else {
Copy link
Member

Choose a reason for hiding this comment

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

I am not sure I understand the rationale behind this change here? Why change the behavior an re-acquire a snapshot?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My understanding is that in the current behavior when the code runs while the mempool is empty, then no transactions will be displayed and client.close() will cause the the script to exit. This happened to me when I ran it the first time (preview testnet) and I wasn't sure if I'd done something wrong.

The new code behaves similarly to the starter kit example where it loops indefinitely and waits for new transactions to come in.

@KtorZ KtorZ merged commit 504c23b into CardanoSolutions:master Jul 1, 2024
13 of 14 checks passed
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.

2 participants