Skip to content

Commit 0483553

Browse files
elsiriontacio
authored andcommitted
fix: support v1 wallet outputs
1 parent d3fa7cc commit 0483553

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

fmo_server/src/federation/observer.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -750,18 +750,21 @@ impl FederationObserver {
750750
(Some(amount_msat), None)
751751
}
752752
"wallet" => {
753-
// TODO: recognize v1 wallet inputs
754-
if let Some(v0_input) = input
753+
let amount = match input
755754
.as_any()
756755
.downcast_ref::<WalletInput>()
757756
.expect("Not Wallet input")
758-
.maybe_v0_ref()
759757
{
760-
let amount_msat = v0_input.0.tx_output().value * 1000;
761-
(Some(amount_msat), None)
762-
} else {
763-
(None, None)
764-
}
758+
WalletInput::V0(wallet_input) => wallet_input.tx_output().value,
759+
WalletInput::V1(wallet_input) => wallet_input.tx_out.value,
760+
_ => {
761+
panic!("Unsupported WalletInput version");
762+
}
763+
};
764+
765+
let amount_msat = amount.to_sat() * 1000;
766+
767+
(Some(amount_msat), None)
765768
}
766769
_ => (None, None),
767770
};

0 commit comments

Comments
 (0)