Skip to content

Commit

Permalink
Add index to download-offers display
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-belcher committed Feb 15, 2022
1 parent d83dcc8 commit 876e986
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,8 @@ pub async fn download_and_display_offers(maker_address: Option<String>) {
}

println!(
"{:70} {:12} {:12} {:12} {:12} {:12} {:12}",
"{:3} {:70} {:12} {:12} {:12} {:12} {:12} {:12}",
"n",
"maker address",
"max size",
"min size",
Expand All @@ -535,15 +536,16 @@ pub async fn download_and_display_offers(maker_address: Option<String>) {
"time rel fee",
"minlocktime"
);
for address in maker_addresses {
for (ii, address) in maker_addresses.iter().enumerate() {
let address_str = match &address {
MakerAddress::Clearnet { address } => address,
MakerAddress::Tor { address } => address,
};
if let Some(offer_address) = addresses_offers_map.get(&address_str) {
let o = &offer_address.offer;
println!(
"{:70} {:12} {:12} {:12} {:12} {:12} {:12}",
"{:3} {:70} {:12} {:12} {:12} {:12} {:12} {:12}",
ii,
address,
o.max_size,
o.min_size,
Expand All @@ -553,7 +555,7 @@ pub async fn download_and_display_offers(maker_address: Option<String>) {
o.minimum_locktime
);
} else {
println!("{:70} UNREACHABLE", address);
println!("{:3} {:70} UNREACHABLE", ii, address);
}
}
}
Expand Down

0 comments on commit 876e986

Please sign in to comment.