~yujiri/libsufec

729e3dff6bb892e1e68262051446fa7430528d68 — Evin Yulo 2 years ago b228c61
fix broken message serialization
1 files changed, 4 insertions(+), 2 deletions(-)

M src/message.rs
M src/message.rs => src/message.rs +4 -2
@@ 33,8 33,10 @@ impl MessageContent {
impl Message {
	pub fn to_bytes(&self) -> Vec<u8> {
		let mut result = vec![self.other_recipients.len() as u8];
		for id in &self.other_recipients {
			result.extend(id.to_bytes());
		for addr in &self.other_recipients {
			let addr_bytes = addr.to_bytes();
			result.extend((addr_bytes.len() as u32).to_be_bytes());
			result.extend(addr_bytes);
		}
		result.extend(self.timestamp.to_be_bytes());
		result.push(self.hashes.len() as u8);