parent
120f87462f
commit
9535b80258
@ -212,6 +212,7 @@ fn spend_header<'a>(tx: &SpendTx) -> Element<'a, Message> {
|
||||
.push_maybe(match tx.status {
|
||||
SpendStatus::Deprecated => Some(badge::deprecated()),
|
||||
SpendStatus::Broadcast => Some(badge::unconfirmed()),
|
||||
SpendStatus::Spent => Some(badge::spent()),
|
||||
_ => None,
|
||||
})
|
||||
.push(
|
||||
|
||||
@ -158,6 +158,7 @@ fn spend_tx_list_view<'a>(i: usize, tx: &SpendTx) -> Element<'a, Message> {
|
||||
.push_maybe(match tx.status {
|
||||
SpendStatus::Deprecated => Some(badge::deprecated()),
|
||||
SpendStatus::Broadcast => Some(badge::unconfirmed()),
|
||||
SpendStatus::Spent => Some(badge::spent()),
|
||||
_ => None,
|
||||
})
|
||||
.push(
|
||||
|
||||
@ -37,6 +37,7 @@ pub enum SpendStatus {
|
||||
Pending,
|
||||
Deprecated,
|
||||
Broadcast,
|
||||
Spent,
|
||||
}
|
||||
|
||||
impl SpendTx {
|
||||
@ -60,7 +61,11 @@ impl SpendTx {
|
||||
inputs_amount += coin.amount;
|
||||
if let Some(info) = coin.spend_info {
|
||||
if info.txid == psbt.unsigned_tx.txid() {
|
||||
status = SpendStatus::Broadcast
|
||||
if info.height.is_some() {
|
||||
status = SpendStatus::Spent
|
||||
} else {
|
||||
status = SpendStatus::Broadcast
|
||||
}
|
||||
} else {
|
||||
status = SpendStatus::Deprecated
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user