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 active_transactions missed notifications #4505

Merged
merged 7 commits into from
Mar 20, 2024

Conversation

clemahieu
Copy link
Contributor

This fixes two instances where notifications could be missed after a block is confirmed.

Blocks confirmed indirectly through confirmation height wouldn't receive balance change notifications because it was directly invoking node.observers.blocks.notify rather than using active_transactions::notify_obserners. This is currently only used by the qt wallet.

The wallet may not have been notified of a block that could be received because of the implementation of active_transactions::block_cemented_callback. The wallet was only notified within active_transactions::handle_confirmation which itself was only called if a transaction was active when active_transactions::block_cemented_callback -> active_transactions::election_status -> active_transactions::confirm_block was invoked. The need for this wallet notification only depends on the source block being confirmed regardless of details about elections. This callback was moved directly on to the node class rather than active_transactions.

This also removes node::process_confirmed_data which was only a utility function for nano::active_transactions and was retrieving data that can be directly obtained from the block itself.

…nfirmation.

Previously the account_balance observers would not be notified if a block was indirectly confirmed without an election
… active_transactions.

This data can now be easily obtained directly from block objects.
This is an interaction between the ledger when a block is confirmed and the wallets that might need to generate receive blocks. Previously this functionality was unnecessarily being handled by the active_transactions class. It could also miss notifications if the block was indirectly confirmed without an active election, or if the election had already been removed from active_transactions.
@qwahzi qwahzi added this to the V27 milestone Mar 19, 2024
@clemahieu clemahieu merged commit a709bf1 into nanocurrency:develop Mar 20, 2024
21 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Merged / V27.0
Development

Successfully merging this pull request may close these issues.

3 participants