diff --git a/book/src/jsonrpc-api.md b/book/src/jsonrpc-api.md index d5f2a1f9cc..40f6d6fd98 100644 --- a/book/src/jsonrpc-api.md +++ b/book/src/jsonrpc-api.md @@ -254,7 +254,8 @@ After connect to the RPC PubSub websocket at `ws://
/`: --- ### accountSubscribe -Subscribe to an account to receive notifications when the userdata for a given account public key changes +Subscribe to an account to receive notifications when the lamports or userdata +for a given account public key changes ##### Parameters: * `string` - account Pubkey, as base-58 encoded string @@ -279,7 +280,7 @@ Subscribe to an account to receive notifications when the userdata for a given a --- ### accountUnsubscribe -Unsubscribe from account userdata change notifications +Unsubscribe from account change notifications ##### Parameters: * `integer` - id of account Subscription to cancel @@ -299,7 +300,8 @@ Unsubscribe from account userdata change notifications --- ### programSubscribe -Subscribe to a program to receive notifications when the userdata for a given account owned by the program changes +Subscribe to a program to receive notifications when the lamports or userdata +for a given account owned by the program changes ##### Parameters: * `string` - program_id Pubkey, as base-58 encoded string diff --git a/core/src/rpc_subscriptions.rs b/core/src/rpc_subscriptions.rs index 348d77e87b..dba527a229 100644 --- a/core/src/rpc_subscriptions.rs +++ b/core/src/rpc_subscriptions.rs @@ -176,10 +176,8 @@ impl RpcSubscriptions { }; for program_id in &programs { let accounts = &bank.get_program_accounts_modified_since_parent(program_id); - if !accounts.is_empty() { - for (pubkey, account) in accounts.iter() { - self.check_program(program_id, pubkey, account); - } + for (pubkey, account) in accounts.iter() { + self.check_program(program_id, pubkey, account); } } diff --git a/runtime/src/accounts.rs b/runtime/src/accounts.rs index 6547aa3061..ebd2d1e647 100644 --- a/runtime/src/accounts.rs +++ b/runtime/src/accounts.rs @@ -842,21 +842,21 @@ impl Accounts { self.accounts_db.add_fork(fork, Some(parent)); } - /// Slow because lock is held for 1 operation insted of many + /// Slow because lock is held for 1 operation instead of many pub fn load_slow(&self, fork: Fork, pubkey: &Pubkey) -> Option