Heck yeah 😄

This commit is contained in:
Nikolaj
2021-11-12 12:58:32 +01:00
parent c367c20cdf
commit bec557f51c
5 changed files with 132 additions and 100 deletions

View File

@@ -67,6 +67,7 @@ typedef struct csc_file {
uint64_t trailblocksize; // Size of last block. Will differ from standard block size if data does not evenly divide amoungst blocks
uint64_t blockcount; // Number of blocks data is divided into
csc_block_t* blocks; // Pointer to array of all blocks
uint8_t completed;
} csc_file_t;
typedef struct csc_peer {
@@ -76,9 +77,6 @@ typedef struct csc_peer {
uint8_t good; // Flag for if this is 'Good' peer. e.g. Always provides valid responses according to protocol
} csc_peer_t;
typedef struct csc_server {
} csc_server_t;
/*
* Parses a hex-string and returns the bytes corresponding to the value
*/
@@ -114,4 +112,6 @@ int csc_download_block(csc_ipport_t client, csc_hashdata_t cascadehash, uint64_t
int get_peers_list(csc_peer_t** peers, uint8_t hash[32]);
void get_block(csc_block_t* block, csc_peer_t peer, unsigned char* hash, char* output_file);
void get_data_sha(const char* sourcedata, unsigned char* hash, uint32_t data_size, int hash_size);
#endif