Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

corrected wrong link #112

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading