pub fn finalize_tx<'a, T: ?Sized, C, K>(
	w: &mut T,
	keychain_mask: Option<&SecretKey>,
	slate: &Slate,
	refresh_from_node: bool,
) -> Result<(Slate, Context), Error>
where
	T: WalletBackend<'a, C, K>,
	C: NodeClient + 'a,
	K: Keychain + 'a,
{
	let mut sl = slate.clone();
	check_ttl(w, &sl, refresh_from_node)?;
	let context = w.get_private_context(keychain_mask, sl.id.as_bytes(), 0)?;
	let parent_key_id = w.parent_key_id();
	tx::complete_tx(&mut *w, keychain_mask, &mut sl, 0, &context)?;
	tx::verify_slate_payment_proof(&mut *w, keychain_mask, &parent_key_id, &context, &sl)?;
	tx::update_stored_tx(&mut *w, keychain_mask, &context, &sl, false)?;
	tx::update_message(&mut *w, keychain_mask, &sl)?;
	{
		let mut batch = w.batch(keychain_mask)?;
		batch.delete_private_context(sl.id.as_bytes(), 0)?;
		batch.commit()?;
	}

	// If Proof available, we can store it at that point
	if let Some(mut proof) = pop_proof_for_slate(&slate.id) {
		proof.amount = context.amount;
		proof.fee = context.fee;
		for input in &context.input_commits {
			proof.inputs.push(input.clone());
		}
		for output in &context.output_commits {
			proof.outputs.push(output.clone());
		}

		proof.store_tx_proof(w.get_data_file_dir(), &slate.id.to_string())?;
	};

	Ok((sl, context))
}
/// Finalize slate
/// Context needed for mwc713 proof of sending funds through mwcmqs
Finalize slate
Context needed for mwc713 proof of sending funds through mwcmqs
Finalize slate Context needed for mwc713 proof of sending funds through mwcmqs
pub fn finalize_tx<'a, T: ?Sized, C, K>(
	w: &mut T,
	keychain_mask: Option<&SecretKey>,
	slate: &Slate,
	refresh_from_node: bool,
) -> Result<(Slate, Context), Error>
where
	T: WalletBackend<'a, C, K>,
	C: NodeClient + 'a,
	K: Keychain + 'a,
{
	let mut sl = slate.clone();
	check_ttl(w, &sl, refresh_from_node)?;
	let context = w.get_private_context(keychain_mask, sl.id.as_bytes(), 0)?;
	let parent_key_id = w.parent_key_id();
	tx::complete_tx(&mut *w, keychain_mask, &mut sl, 0, &context)?;
	tx::verify_slate_payment_proof(&mut *w, keychain_mask, &parent_key_id, &context, &sl)?;
	tx::update_stored_tx(&mut *w, keychain_mask, &context, &sl, false)?;
	tx::update_message(&mut *w, keychain_mask, &sl)?;
	{
		let mut batch = w.batch(keychain_mask)?;
		batch.delete_private_context(sl.id.as_bytes(), 0)?;
		batch.commit()?;
	}
	// If Proof available, we can store it at that point
	if let Some(mut proof) = pop_proof_for_slate(&slate.id) {
		proof.amount = context.amount;
		proof.fee = context.fee;
		for input in &context.input_commits {
			proof.inputs.push(input.clone());
		}
		for output in &context.output_commits {
			proof.outputs.push(output.clone());
		}
		proof.store_tx_proof(w.get_data_file_dir(), &slate.id.to_string())?;
	};
	Ok((sl, context))
}
pub fn finalize_tx < ' a , T : ? Sized , C , K > ( w : & mut T , keychain_mask : Option < & SecretKey > , slate : & Slate , refresh_from_node : bool , ) -> Result < ( Slate , Context ) , Error > where T : WalletBackend < ' a , C , K > , C : NodeClient + ' a , K : Keychain + ' a , { let mut sl = slate . clone ( ) ; check_ttl ( w , & sl , refresh_from_node ) ? ; let context = w . get_private_context ( keychain_mask , sl . id . as_bytes ( ) , 0 ) ? ; let parent_key_id = w . parent_key_id ( ) ; tx :: complete_tx ( & mut * w , keychain_mask , & mut sl , 0 , & context ) ? ; tx :: verify_slate_payment_proof ( & mut * w , keychain_mask , & parent_key_id , & context , & sl ) ? ; tx :: update_stored_tx ( & mut * w , keychain_mask , & context , & sl , false ) ? ; tx :: update_message ( & mut * w , keychain_mask , & sl ) ? ; { let mut batch = w . batch ( keychain_mask ) ? ; batch . delete_private_context ( sl . id . as_bytes ( ) , 0 ) ? ; batch . commit ( ) ? ; } // If Proof available, we can store it at that point if let Some ( mut proof ) = pop_proof_for_slate ( & slate . id ) { proof . amount = context . amount ; proof . fee = context . fee ; for input in & context . input_commits { proof . inputs . push ( input . clone ( ) ) ; } for output in & context . output_commits { proof . outputs . push ( output . clone ( ) ) ; } proof . store_tx_proof ( w . get_data_file_dir ( ) , & slate . id . to_string ( ) ) ? ; } ; Ok ( ( sl , context ) ) }
Finalize slate
Context needed for mwc713 proof of sending funds through mwcmqs
Finalize slate Context needed for mwc713 proof of sending funds through mwcmqs
w
&mut T
keychain_mask
Option<&SecretKey>
slate
&Slate
refresh_from_node
bool
w
&mut T
keychain_mask
Option<&SecretKey>
slate
&Slate
refresh_from_node
bool