Swap-id as file name for generated Monero wallet

Instead of using the private view-key as wallet filename we use the swap-id, to be able to identify which wallet is associated with which swap.
This commit is contained in:
Daniel Karzel 2021-04-08 15:35:21 +10:00
parent 548f057726
commit 489696ee08
No known key found for this signature in database
GPG key ID: 30C3FC2E438ADB6E
4 changed files with 27 additions and 6 deletions

View file

@ -73,6 +73,7 @@ impl Wallet {
/// keys. The generated wallet will remain loaded.
pub async fn create_from_and_load(
&self,
file_name: &str,
private_spend_key: PrivateKey,
private_view_key: PrivateViewKey,
restore_height: BlockHeight,
@ -90,6 +91,7 @@ impl Wallet {
let _ = wallet
.generate_from_keys(
file_name,
&address.to_string(),
&private_spend_key.to_string(),
&PrivateKey::from(private_view_key).to_string(),
@ -106,6 +108,7 @@ impl Wallet {
/// stored name.
pub async fn create_from(
&self,
file_name: &str,
private_spend_key: PrivateKey,
private_view_key: PrivateViewKey,
restore_height: BlockHeight,
@ -124,6 +127,7 @@ impl Wallet {
let _ = wallet
.generate_from_keys(
file_name,
&temp_wallet_address.to_string(),
&private_spend_key.to_string(),
&PrivateKey::from(private_view_key).to_string(),