From b4308e90750db0a4d4e22c88bb2bb8062565e48e Mon Sep 17 00:00:00 2001 From: Quentin Le Sceller Date: Wed, 28 Mar 2018 12:36:10 -0400 Subject: [PATCH] Cleans the wallet awaiting confirmation when destination is incorrect. Fix #900 (#902) --- wallet/src/sender.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wallet/src/sender.rs b/wallet/src/sender.rs index f73ea4bcb..d193076f6 100644 --- a/wallet/src/sender.rs +++ b/wallet/src/sender.rs @@ -119,6 +119,10 @@ pub fn issue_send_tx( } else */ if &dest[..4] != "http" { + WalletData::with_wallet(&config.data_file_dir, |wallet_data| { + info!(LOGGER, "cleaning up unused change output from wallet"); + wallet_data.delete_output(&change_key); + }); panic!( "dest formatted as {} but send -d expected stdout or http://IP:port", dest