|
|
|
@ -183,11 +183,11 @@ fn search(value: &RawStr) -> Redirect {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else if sl == 97 {
|
|
|
|
|
// Equal to 95 characters is probably a wallet address.
|
|
|
|
|
// Equal to 97 characters is probably a wallet address.
|
|
|
|
|
// For this let's just redirect to the `show_wallet_address` route.
|
|
|
|
|
return Redirect::found(uri!(show_wallet_address: value.as_str(), "", "", "", ""))
|
|
|
|
|
} else if sl == 105 {
|
|
|
|
|
// Equal to 105 characters is probably an integrated address.
|
|
|
|
|
} else if sl == 107 {
|
|
|
|
|
// Equal to 107 characters is probably an integrated address.
|
|
|
|
|
// For this let's just redirect to the `show_wallet_address` route.
|
|
|
|
|
return Redirect::found(uri!(show_wallet_address: value.as_str(), "", "", "", ""))
|
|
|
|
|
} else {
|
|
|
|
@ -212,26 +212,25 @@ fn search(value: &RawStr) -> Redirect {
|
|
|
|
|
|
|
|
|
|
#[get("/")]
|
|
|
|
|
fn index() -> Template {
|
|
|
|
|
let daemon_uri = env::var("DAEMON_URI").unwrap();
|
|
|
|
|
let daemon_info: GetInfoResult = build_rpc(
|
|
|
|
|
&"get_info", None, true
|
|
|
|
|
).send().unwrap().json().unwrap();
|
|
|
|
|
|
|
|
|
|
let mut tx_pool: GetTransactionPool = build_rpc(
|
|
|
|
|
let tx_pool: GetTransactionPool = build_rpc(
|
|
|
|
|
&"get_transaction_pool", None, true
|
|
|
|
|
).send().unwrap().json().unwrap();
|
|
|
|
|
|
|
|
|
|
let mut tx_json_raw: Vec<TransactionJSON> = vec![];
|
|
|
|
|
let mut pool_txs: Vec<Transactions> = tx_pool.transactions.unwrap_or(vec![]);
|
|
|
|
|
|
|
|
|
|
for f in &mut tx_pool.transactions {
|
|
|
|
|
for f in &mut pool_txs {
|
|
|
|
|
f.process();
|
|
|
|
|
let j: TransactionJSON = serde_json::from_str(&f.tx_json).unwrap();
|
|
|
|
|
tx_json_raw.push(j)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let context: JsonValue = json!({
|
|
|
|
|
"daemon_info": daemon_info,
|
|
|
|
|
"tx_pool_txs": tx_pool.transactions,
|
|
|
|
|
"tx_json": tx_json_raw
|
|
|
|
|
"tx_pool_txs": pool_txs,
|
|
|
|
|
"daemon_uri": daemon_uri
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Template::render("index", context)
|
|
|
|
|