Skip to content

Commit

Permalink
Show QR code for listener address (#650)
Browse files Browse the repository at this point in the history
Co-authored-by: cliik <cliik@example.com>
  • Loading branch information
cliik and cliik authored Jul 12, 2022
1 parent b45802a commit 7b1eab6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion controller/src/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use grin_wallet_util::OnionV3Address;
use hyper::body;
use hyper::header::HeaderValue;
use hyper::{Body, Request, Response, StatusCode};
use qr_code::QrCode;
use serde::{Deserialize, Serialize};
use serde_json;
use std::collections::HashMap;
Expand Down Expand Up @@ -351,7 +352,11 @@ where

warn!("HTTP Foreign listener started.");
if let Some(a) = address {
warn!("Slatepack Address is: {}", a);
let qr_string = match QrCode::new(a.to_string()) {
Ok(qr) => qr.to_string(false, 3),
Err(_) => "Failed to generate QR code!".to_string(),
};
warn!("Slatepack Address is: {}\n{}", a, qr_string);
}

api_thread
Expand Down

0 comments on commit 7b1eab6

Please sign in to comment.