Skip to content

Commit

Permalink
corrected wrong link (#112)
Browse files Browse the repository at this point in the history
Co-authored-by: Timothée Delabrouille <[email protected]>
  • Loading branch information
gdnathan and tdelabro authored Sep 20, 2024
1 parent 8561fcb commit 15f24e2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/network/protocol/messages/verack.zig
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const CompactSizeUint = @import("bitcoin-primitives").types.CompatSizeUint;

/// VerackMessage represents the "verack" message
///
/// https://developer.bitcoin.org/reference/p2p_networking.html#version
/// https://developer.bitcoin.org/reference/p2p_networking.html#verack
pub const VerackMessage = struct {
// verack message do not contain any payload, thus there is no field

Expand Down Expand Up @@ -42,7 +42,6 @@ pub const VerackMessage = struct {
_ = self;
return 0;
}

};

// TESTS
Expand Down
7 changes: 4 additions & 3 deletions src/network/wire/lib.zig
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub fn sendMessage(allocator: std.mem.Allocator, w: anytype, protocol_version: i
defer allocator.free(payload);
const checksum = computePayloadChecksum(payload);

// I believe it's safe. No payload will be longer than u32.MAX
// No payload will be longer than u32.MAX
const payload_len: u32 = @intCast(payload.len);

try w.writeAll(&network_id);
Expand Down Expand Up @@ -79,9 +79,10 @@ pub fn receiveMessage(allocator: std.mem.Allocator, r: anytype) !protocol.messag
const message: protocol.messages.Message = if (std.mem.eql(u8, &command, protocol.messages.VersionMessage.name()))
protocol.messages.Message{ .Version = try protocol.messages.VersionMessage.deserializeReader(allocator, r) }
else if (std.mem.eql(u8, &command, protocol.messages.VerackMessage.name()))
protocol.messages.Message{ .Verack = try protocol.messages.VerackMessage.deserializeReader(allocator, r)}

protocol.messages.Message{ .Verack = try protocol.messages.VerackMessage.deserializeReader(allocator, r) }
else if (std.mem.eql(u8, &command, protocol.messages.MempoolMessage.name()))
protocol.messages.Message{ .Mempool = try protocol.messages.MempoolMessage.deserializeReader(allocator, r)}
protocol.messages.Message{ .Mempool = try protocol.messages.MempoolMessage.deserializeReader(allocator, r) }
else if (std.mem.eql(u8, &command, protocol.messages.GetaddrMessage.name()))
protocol.messages.Message{ .Getaddr = try protocol.messages.GetaddrMessage.deserializeReader(allocator, r) }
else
Expand Down

0 comments on commit 15f24e2

Please sign in to comment.