diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-06 01:53:03 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-06 01:53:03 +0000 |
| commit | ef9f06d43fc6577c15df2256abbb25b20d4227b8 (patch) | |
| tree | 7e9132aa871fdc01cb95268d2f5ea3bb11853ddf /src/nostr.h | |
| parent | be63e83d79e7e00e6b8ca889a70e6a19886aa1d8 (diff) | |
| parent | ceae3d076b5ad11ee84729ae43f14e9312896646 (diff) | |
Bring main onto the line this project actually ships (incl. the 1.2.23 compactblock port)
Closes #6, #7, #8, #11, #35, #34, #29, #28, #27, and #16
See merge request !16
Diffstat (limited to 'src/nostr.h')
| -rw-r--r-- | src/nostr.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/nostr.h b/src/nostr.h index 827b2f3..0dd919d 100644 --- a/src/nostr.h +++ b/src/nostr.h | |||
| @@ -40,6 +40,13 @@ std::string BtfActiveRelay(); | |||
| 40 | // Record the relay this node just registered its service at (thread-safe). | 40 | // Record the relay this node just registered its service at (thread-safe). |
| 41 | void BtfSetActiveRelay(const std::string& relay); | 41 | void BtfSetActiveRelay(const std::string& relay); |
| 42 | 42 | ||
| 43 | // Optional Tor hidden-service endpoint for this node's normal P2P listener. | ||
| 44 | // Set by /onionservice=HOST.onion:PORT. The endpoint is signed into this node's | ||
| 45 | // .btf descriptor, so peers with -tor can dial it directly before falling back | ||
| 46 | // to rendezvous relays. | ||
| 47 | bool BtfSetLocalOnionEndpoint(const std::string& endpoint, std::string& errOut); | ||
| 48 | std::string BtfLocalOnionEndpoint(); | ||
| 49 | |||
| 43 | // If set (via /announcerelay=host:port), this node announces that relay on | 50 | // If set (via /announcerelay=host:port), this node announces that relay on |
| 44 | // Nostr so other nodes discover it automatically -- no manual seed-list edit. | 51 | // Nostr so other nodes discover it automatically -- no manual seed-list edit. |
| 45 | extern std::string strBtfAnnounceRelay; | 52 | extern std::string strBtfAnnounceRelay; |
| @@ -53,6 +60,9 @@ extern bool fBtfRelayPinned; | |||
| 53 | bool LooksLikeRelay(const std::string& r); | 60 | bool LooksLikeRelay(const std::string& r); |
| 54 | // Every relay to try: curated seeds + relays discovered from Nostr announcements. | 61 | // Every relay to try: curated seeds + relays discovered from Nostr announcements. |
| 55 | std::vector<std::string> BtfAllRelays(); | 62 | std::vector<std::string> BtfAllRelays(); |
| 63 | // Relays discovered from Nostr, ignoring the pin. For reporting what a pin | ||
| 64 | // excludes -- never for choosing a relay to register or dial at. | ||
| 65 | std::vector<std::string> BtfDiscoveredRelays(); | ||
| 56 | 66 | ||
| 57 | struct BtfPoolAnnouncement | 67 | struct BtfPoolAnnouncement |
| 58 | { | 68 | { |
| @@ -102,12 +112,15 @@ void* BtfSecpContext(); | |||
| 102 | // self-certified descriptor and return its meeting node ("host:port") and | 112 | // self-certified descriptor and return its meeting node ("host:port") and |
| 103 | // x25519 public key for the end-to-end channel. | 113 | // x25519 public key for the end-to-end channel. |
| 104 | bool BtfResolve(const std::string& btfAddr, std::string& meetingHostPort, | 114 | bool BtfResolve(const std::string& btfAddr, std::string& meetingHostPort, |
| 105 | unsigned char enc_pub[32]); | 115 | unsigned char enc_pub[32], |
| 116 | std::string* onionHostPort = NULL); | ||
| 106 | 117 | ||
| 107 | // Result of resolving one .btf address via BtfResolveMany. | 118 | // Result of resolving one .btf address via BtfResolveMany. |
| 108 | struct BtfResolvedPeer | 119 | struct BtfResolvedPeer |
| 109 | { | 120 | { |
| 110 | std::string meetingHostPort; | 121 | std::string meetingHostPort; |
| 122 | std::string onionHostPort; | ||
| 123 | std::string descriptor; | ||
| 111 | unsigned char enc_pub[32]; | 124 | unsigned char enc_pub[32]; |
| 112 | }; | 125 | }; |
| 113 | 126 | ||