mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Save important parts of save first.
This might reduce the likelyness of broken saves.
This commit is contained in:
parent
1de2ef78cf
commit
efcb66ab1a
|
@ -2584,12 +2584,6 @@ void messenger_save(const Messenger *m, uint8_t *data)
|
|||
save_keys(m->net_crypto, data + size32);
|
||||
data += len;
|
||||
|
||||
len = DHT_size(m->dht);
|
||||
type = MESSENGER_STATE_TYPE_DHT;
|
||||
data = z_state_save_subheader(data, len, type);
|
||||
DHT_save(m->dht, data);
|
||||
data += len;
|
||||
|
||||
len = saved_friendslist_size(m);
|
||||
type = MESSENGER_STATE_TYPE_FRIENDS;
|
||||
data = z_state_save_subheader(data, len, type);
|
||||
|
@ -2614,6 +2608,12 @@ void messenger_save(const Messenger *m, uint8_t *data)
|
|||
*data = m->userstatus;
|
||||
data += len;
|
||||
|
||||
len = DHT_size(m->dht);
|
||||
type = MESSENGER_STATE_TYPE_DHT;
|
||||
data = z_state_save_subheader(data, len, type);
|
||||
DHT_save(m->dht, data);
|
||||
data += len;
|
||||
|
||||
Node_format relays[NUM_SAVED_TCP_RELAYS];
|
||||
type = MESSENGER_STATE_TYPE_TCP_RELAY;
|
||||
uint8_t *temp_data = data;
|
||||
|
|
Loading…
Reference in New Issue
Block a user