You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The wallet returns stale balance results with no warning to the user if it cannot
get a live state from the base node. This will lead clients to use stale results.
There is no way to distinguish between stale and updated results.
This is because the GetBalance operation uses the get_chain_metadata function to
calculate the current tip. GetChainMetadata in turn will return an Ok result even
when it fetches possibly outdated data from its database.
OutputManagerRequest::GetBalance => {let current_tip_for_time_lock_calculation = matchself.base_node_service.get_chain_metadata().await{Ok(metadata) => metadata.map(|m|
m.height_of_longest_chain()),Err(_) => None,};self.get_balance(current_tip_for_time_lock_calculation).map(OutputManagerResponse::Balance)},BaseNodeServiceRequest::GetChainMetadata => matchself.get_state().await.chain_metadata{Some(metadata) =>
Ok(BaseNodeServiceResponse::ChainMetadata(Some(metadata))),None => {// if we don't have live state, check if we've
previously stored state in the wallet db
let metadata = self.db.get_chain_metadata()?;Ok(BaseNodeServiceResponse::ChainMetadata(metadata))},},
Provide a clear warning to users that they are getting outdated data
The text was updated successfully, but these errors were encountered:
Description
---
block wallet from sending if metadata from base node is stale and older
than 15 mins
The console wallet will print out a warning if the connection is stale.
Motivation and Context
---
Sending via old metadata can cause issues with wallets using old data.
The transactions might not be valid anymore
Fixes: #5855
The wallet returns stale balance results with no warning to the user if it cannot
get a live state from the base node. This will lead clients to use stale results.
There is no way to distinguish between stale and updated results.
This is because the GetBalance operation uses the get_chain_metadata function to
calculate the current tip. GetChainMetadata in turn will return an Ok result even
when it fetches possibly outdated data from its database.
Provide a clear warning to users that they are getting outdated data
The text was updated successfully, but these errors were encountered: