Skip to content
This repository was archived by the owner on Feb 3, 2025. It is now read-only.

Commit 570e695

Browse files
committed
Define payjoin network resources in mod
1 parent 4a681f2 commit 570e695

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

mutiny-core/src/nodemanager.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,16 +1024,11 @@ impl<S: MutinyStorage> NodeManager<S> {
10241024
let pj = {
10251025
// DANGER! TODO get from &self config, do not get config directly from PAYJOIN_DIR ohttp-gateway
10261026
// That would reveal IP address
1027-
const OHTTP_RELAYS: [&str; 2] = [
1028-
"https://ohttp-relay.obscuravpn.io/payjoin",
1029-
"https://bobspace-ohttp.duckdns.org",
1030-
];
1031-
const PAYJOIN_DIR: &str = "https://payjo.in";
10321027

10331028
let http_client = reqwest::Client::builder().build().unwrap();
10341029

10351030
let ohttp_config_base64 = http_client
1036-
.get(format!("{}/ohttp-config", PAYJOIN_DIR))
1031+
.get(format!("{}/ohttp-config", crate::payjoin::PAYJOIN_DIR))
10371032
.send()
10381033
.await
10391034
.unwrap()
@@ -1042,11 +1037,10 @@ impl<S: MutinyStorage> NodeManager<S> {
10421037
.unwrap();
10431038

10441039
let mut enroller = payjoin::receive::v2::Enroller::from_relay_config(
1045-
PAYJOIN_DIR,
1040+
crate::payjoin::PAYJOIN_DIR,
10461041
&ohttp_config_base64,
1047-
OHTTP_RELAYS[0], // TODO pick ohttp relay at random
1042+
crate::payjoin::OHTTP_RELAYS[0], // TODO pick ohttp relay at random
10481043
);
1049-
10501044
// enroll client
10511045
let (req, context) = enroller.extract_req().unwrap();
10521046
let ohttp_response = http_client

mutiny-core/src/payjoin.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ use payjoin::receive::v2::Enrolled;
66
use serde::{Deserialize, Serialize};
77
use std::collections::HashMap;
88

9+
pub(crate) const OHTTP_RELAYS: [&str; 2] = [
10+
"https://ohttp-relay.obscuravpn.io/payjoin",
11+
"https://bobspace-ohttp.duckdns.org",
12+
];
13+
pub(crate) const PAYJOIN_DIR: &str = "https://payjo.in";
14+
915
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1016
pub struct Session {
1117
pub enrolled: Enrolled,

0 commit comments

Comments
 (0)