Add From: txid label for coin selection view

This commit is contained in:
edouard 2023-10-20 18:29:45 +02:00
parent 07fbc0c1b3
commit 1aae2a52da
2 changed files with 14 additions and 0 deletions

View File

@ -126,6 +126,7 @@ impl State for CreateSpendPanel {
let mut targets = HashSet::<LabelItem>::new();
for coin in coins {
targets.insert(LabelItem::OutPoint(coin.outpoint));
targets.insert(LabelItem::Txid(coin.outpoint.txid));
}
daemon2.get_labels(&targets).map_err(|e| e.into())
},

View File

@ -361,6 +361,19 @@ fn coin_list_view<'a>(
.push(
if let Some(label) = coins_labels.get(&coin.outpoint.to_string()) {
Container::new(p1_bold(label)).width(Length::Fill)
} else if let Some(label) = coins_labels.get(&coin.outpoint.txid.to_string()) {
Container::new(
Row::new()
.spacing(5)
.push(
// It it not possible to know if a coin is a
// change coin or not so for now, From is
// enough
p1_bold("From").style(color::GREY_3),
)
.push(p1_bold(label)),
)
.width(Length::Fill)
} else {
Container::new(p1_bold("")).width(Length::Fill)
},