Skip to content

Commit

Permalink
filter for asset ID in RgbLibDatabase::get_asset_balance()
Browse files Browse the repository at this point in the history
  • Loading branch information
nicbus committed Jan 8, 2024
1 parent 515f772 commit 163d964
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/database/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,8 +647,12 @@ impl RgbLibDatabase {
.filter(|t| t.incoming && t.recipient_type == Some(RecipientType::Witness))
.filter_map(
|t| match t.related_transfers(&asset_transfers, &batch_transfers) {
Ok((_, bt)) => {
Ok((at, bt)) => {
if bt.status.waiting_confirmations() {
// filter for asset ID (always present in WaitingConfirmations status)
if at.asset_id.unwrap() != asset_id {
return None;
}
Some(Ok(t.amount.parse::<u64>().unwrap()))
} else {
None
Expand Down

0 comments on commit 163d964

Please sign in to comment.