Skip to content

Commit 5e46de7

Browse files
authored
Merge pull request #104 from Foundation-Devices/fix_rename_tag_issue
ENV-2189 Fix rename tag deletes existing tag
2 parents 70a666e + 391826a commit 5e46de7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/account.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,11 @@ impl<P: WalletPersister> NgAccount<P> {
584584
pub fn remove_tag(&self, target_tag: &str, rename_to: Option<&str>) -> anyhow::Result<()> {
585585
self.meta_storage.remove_tag(target_tag)?;
586586
let utxos = self.utxos()?;
587+
if let Some(new_tag) = rename_to
588+
&& !new_tag.is_empty()
589+
{
590+
self.meta_storage.add_tag(new_tag)?;
591+
}
587592
for output in utxos {
588593
match &output.tag {
589594
None => {}

0 commit comments

Comments
 (0)