Review comments
This commit is contained in:
parent
e888c90ecf
commit
259c820f15
@ -254,7 +254,8 @@ After connect to the RPC PubSub websocket at `ws://<ADDRESS>/`:
|
|||||||
---
|
---
|
||||||
|
|
||||||
### accountSubscribe
|
### 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:
|
##### Parameters:
|
||||||
* `string` - account Pubkey, as base-58 encoded string
|
* `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
|
### accountUnsubscribe
|
||||||
Unsubscribe from account userdata change notifications
|
Unsubscribe from account change notifications
|
||||||
|
|
||||||
##### Parameters:
|
##### Parameters:
|
||||||
* `integer` - id of account Subscription to cancel
|
* `integer` - id of account Subscription to cancel
|
||||||
@ -299,7 +300,8 @@ Unsubscribe from account userdata change notifications
|
|||||||
---
|
---
|
||||||
|
|
||||||
### programSubscribe
|
### 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:
|
##### Parameters:
|
||||||
* `string` - program_id Pubkey, as base-58 encoded string
|
* `string` - program_id Pubkey, as base-58 encoded string
|
||||||
|
@ -176,10 +176,8 @@ impl RpcSubscriptions {
|
|||||||
};
|
};
|
||||||
for program_id in &programs {
|
for program_id in &programs {
|
||||||
let accounts = &bank.get_program_accounts_modified_since_parent(program_id);
|
let accounts = &bank.get_program_accounts_modified_since_parent(program_id);
|
||||||
if !accounts.is_empty() {
|
for (pubkey, account) in accounts.iter() {
|
||||||
for (pubkey, account) in accounts.iter() {
|
self.check_program(program_id, pubkey, account);
|
||||||
self.check_program(program_id, pubkey, account);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -842,21 +842,21 @@ impl Accounts {
|
|||||||
self.accounts_db.add_fork(fork, Some(parent));
|
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<Account> {
|
pub fn load_slow(&self, fork: Fork, pubkey: &Pubkey) -> Option<Account> {
|
||||||
self.accounts_db
|
self.accounts_db
|
||||||
.load(fork, pubkey, true)
|
.load(fork, pubkey, true)
|
||||||
.filter(|acc| acc.lamports != 0)
|
.filter(|acc| acc.lamports != 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 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_no_parent(&self, fork: Fork, pubkey: &Pubkey) -> Option<Account> {
|
pub fn load_slow_no_parent(&self, fork: Fork, pubkey: &Pubkey) -> Option<Account> {
|
||||||
self.accounts_db
|
self.accounts_db
|
||||||
.load(fork, pubkey, false)
|
.load(fork, pubkey, false)
|
||||||
.filter(|acc| acc.lamports != 0)
|
.filter(|acc| acc.lamports != 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 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_by_program_slow_no_parent(
|
pub fn load_by_program_slow_no_parent(
|
||||||
&self,
|
&self,
|
||||||
fork: Fork,
|
fork: Fork,
|
||||||
@ -869,7 +869,7 @@ impl Accounts {
|
|||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Slow because lock is held for 1 operation insted of many
|
/// Slow because lock is held for 1 operation instead of many
|
||||||
pub fn store_slow(&self, fork: Fork, pubkey: &Pubkey, account: &Account) {
|
pub fn store_slow(&self, fork: Fork, pubkey: &Pubkey, account: &Account) {
|
||||||
self.accounts_db.store(fork, pubkey, account);
|
self.accounts_db.store(fork, pubkey, account);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user