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);