pub fn node_height(
		&self,
		keychain_mask: Option<&SecretKey>,
	) -> Result<NodeHeightResult, Error> {
		{
			let mut w_lock = self.wallet_inst.lock();
			let w = w_lock.lc_provider()?.wallet_inst()?;
			// Test keychain mask, to keep API consistent
			let _ = w.keychain(keychain_mask)?;
		}
		let mut res = owner::node_height(self.wallet_inst.clone(), keychain_mask)?;
		if self.doctest_mode {
			// return a consistent hash for doctest
			res.header_hash =
				"d4b3d3c40695afd8c7760f8fc423565f7d41310b7a4e1c4a4a7950a66f16240d".to_owned();
		}
		Ok(res)
	}
/// Retrieves the last known height known by the wallet. This is determined as follows:
/// * If the wallet can successfully contact its configured node, the reported node
/// height is returned, and the `updated_from_node` field in the response is `true`
/// * If the wallet cannot contact the node, this function returns the maximum height
/// of all outputs contained within the wallet, and the `updated_from_node` fields
/// in the response is set to false.
///
/// Clients should generally ensure the `updated_from_node` field is returned as
/// `true` before assuming the height for any operation.
///
/// # Arguments
///
/// * `keychain_mask` - Wallet secret mask to XOR against the stored wallet seed before using, if
/// being used.
///
/// # Returns
/// * Ok with a  [`NodeHeightResult`](../mimble_wallet_libwallet/types/struct.NodeHeightResult.html)
/// if successful. If the height result was obtained from the configured node,
/// `updated_from_node` will be set to `true`
/// * or [`libwallet::Error`](../mimble_wallet_libwallet/struct.Error.html) if an error is encountered.
///
/// # Example
/// Set up as in [`new`](struct.Owner.html#method.new) method above.
/// ```
/// # mimble_wallet_api::doctest_helper_setup_doc_env!(wallet, wallet_config);
///
/// let api_owner = Owner::new(wallet.clone(), None, None);
/// let result = api_owner.node_height(None);
///
/// if let Ok(node_height_result) = result {
///     if node_height_result.updated_from_node {
///          //we can assume node_height_result.height is relatively safe to use
///
///     }
///     //...
/// }
/// ```
Retrieves the last known height known by the wallet.

Clients should generally ensure the `updated_from_node` field is returned as
`true` before assuming the height for any operation.
Retrieves the last known height known by the wallet . Clients should generally ensure the ` updated_from_node ` field is returned as ` true ` before assuming the height for any operation .
pub fn node_height(
		&self,
		keychain_mask: Option<&SecretKey>,
	) -> Result<NodeHeightResult, Error> {
		{
			let mut w_lock = self.wallet_inst.lock();
			let w = w_lock.lc_provider()?.wallet_inst()?;
			// Test keychain mask, to keep API consistent
			let _ = w.keychain(keychain_mask)?;
		}
		let mut res = owner::node_height(self.wallet_inst.clone(), keychain_mask)?;
		if self.doctest_mode {
			// return a consistent hash for doctest
			res.header_hash =
				"d4b3d3c40695afd8c7760f8fc423565f7d41310b7a4e1c4a4a7950a66f16240d".to_owned();
		}
		Ok(res)
	}
pub fn node_height ( & self , keychain_mask : Option < & SecretKey > , ) -> Result < NodeHeightResult , Error > { { let mut w_lock = self . wallet_inst . lock ( ) ; let w = w_lock . lc_provider ( ) ? . wallet_inst ( ) ? ; // Test keychain mask, to keep API consistent let _ = w . keychain ( keychain_mask ) ? ; } let mut res = owner :: node_height ( self . wallet_inst . clone ( ) , keychain_mask ) ? ; if self . doctest_mode { // return a consistent hash for doctest res . header_hash = " " . to_owned ( ) ; } Ok ( res ) }
Retrieves the last known height known by the wallet.
Retrieves the last known height known by the wallet .
&self
keychain_mask
Option<&SecretKey>
Ok with a  [`NodeHeightResult`](../mimble_wallet_libwallet/types/struct.NodeHeightResult.html)
if successful. If the height result was obtained from the configured node,
`updated_from_node` will be set to `true`
or [`libwallet::Error`](../mimble_wallet_libwallet/struct.Error.html) if an error is encountered.
Ok with a [ ` NodeHeightResult ` ] ( .. / mimble_wallet_libwallet / types / struct . NodeHeightResult . html ) if successful . If the height result was obtained from the configured node ` updated_from_node ` will be set to ` true ` or [ ` libwallet :: Error ` ] ( .. / mimble_wallet_libwallet / struct . Error . html ) if an error is encountered .
&self
keychain_mask
Option<&SecretKey>
example
Set up as in [`new`](struct.Owner.html#method.new) method above.
Set up as in [ ` new ` ] ( struct . Owner . html#method . new ) method above .
mimble_wallet_api::doctest_helper_setup_doc_env!(wallet, wallet_config);
let api_owner = Owner::new(wallet.clone(), None, None);
let result = api_owner.node_height(None).

if let Ok(node_height_result) = result {
if node_height_result.updated_from_node {
we can assume node_height_result.height is relatively safe to use


let api_owner = Owner :: new ( wallet . clone () None None ) ; let result = api_owner . node_height ( None ) . if let Ok ( node_height_result ) = result { if node_height_result . updated_from_node { we can assume node_height_result . height is relatively safe to use