Skip to content

Commit a38a9f6

Browse files
authored
Feature/addressing update (#237)
* Typo I've never noticed before * Sphinx version update * Updated 'address' to be 'recipient' (i.e. address + gateway) * Updated websocket examples to use the updated structure
1 parent 7f99c28 commit a38a9f6

File tree

22 files changed

+5847
-4714
lines changed

22 files changed

+5847
-4714
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

clients/desktop/examples/go-examples/websocket/filesend.go

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"github.com/btcsuite/btcutil/base58"
77
"github.com/gorilla/websocket"
88
"io/ioutil"
9+
"strings"
910
)
1011

1112
func getSelfAddress(conn *websocket.Conn) string {
@@ -38,14 +39,19 @@ func main() {
3839

3940
selfAddress := getSelfAddress(conn)
4041
fmt.Printf("our address is: %v\n", selfAddress)
41-
decodedAddress := base58.Decode(selfAddress)
42+
43+
// we receive our address in string format of OUR_PUB_KEY @ OUR_GATE_PUB_KEY
44+
// both keys are 32 bytes and we need to encode them as binary without the '@' sign
45+
splitAddress := strings.Split(selfAddress, "@");
46+
decodedDestination := base58.Decode(splitAddress[0])
47+
decodedGateway := base58.Decode(splitAddress[1])
4248

4349
read_data, err := ioutil.ReadFile("dummy_file")
4450
if err != nil {
4551
panic(err)
4652
}
4753

48-
payload := append(decodedAddress[:], read_data[:]...)
54+
payload := append(decodedDestination[:], append(decodedGateway[:], read_data[:]...)...)
4955
fmt.Printf("sending content of 'dummy file' over the mix network...\n")
5056
if err = conn.WriteMessage(websocket.BinaryMessage, payload); err != nil {
5157
panic(err)

0 commit comments

Comments
 (0)