diff --git a/rhizome.h b/rhizome.h index 6e5aa9ff..91fd46c7 100644 --- a/rhizome.h +++ b/rhizome.h @@ -624,8 +624,8 @@ int rhizome_update_file_priority(const char *fileid); enum rhizome_bundle_status rhizome_find_duplicate(const rhizome_manifest *m, rhizome_manifest **found); int rhizome_manifest_to_bar(rhizome_manifest *m,unsigned char *bar); uint64_t rhizome_bar_version(const unsigned char *bar); -uint64_t rhizome_bar_bidprefix_ll(unsigned char *bar); -int rhizome_is_bar_interesting(unsigned char *bar); +uint64_t rhizome_bar_bidprefix_ll(const unsigned char *bar); +int rhizome_is_bar_interesting(const unsigned char *bar); int rhizome_is_manifest_interesting(rhizome_manifest *m); int rhizome_retrieve_manifest(const rhizome_bid_t *bid, rhizome_manifest *m); int rhizome_retrieve_manifest_by_prefix(const unsigned char *prefix, unsigned prefix_len, rhizome_manifest *m); diff --git a/rhizome_database.c b/rhizome_database.c index be5b28e2..9f3da86f 100644 --- a/rhizome_database.c +++ b/rhizome_database.c @@ -2089,7 +2089,7 @@ static int is_interesting(const char *id_hex, uint64_t version) OUT(); } -int rhizome_is_bar_interesting(unsigned char *bar) +int rhizome_is_bar_interesting(const unsigned char *bar) { uint64_t version = rhizome_bar_version(bar); char id_hex[RHIZOME_BAR_PREFIX_BYTES *2 + 2]; diff --git a/rhizome_packetformats.c b/rhizome_packetformats.c index e0570cd9..c7c9e716 100644 --- a/rhizome_packetformats.c +++ b/rhizome_packetformats.c @@ -129,7 +129,7 @@ uint64_t rhizome_bar_version(const unsigned char *bar) /* This function only displays the first 8 bytes, and should not be used for comparison. */ -uint64_t rhizome_bar_bidprefix_ll(unsigned char *bar) +uint64_t rhizome_bar_bidprefix_ll(const unsigned char *bar) { uint64_t bidprefix=0; int i; diff --git a/rhizome_sync.c b/rhizome_sync.c index fbf723b6..24dcd46a 100644 --- a/rhizome_sync.c +++ b/rhizome_sync.c @@ -388,7 +388,8 @@ static void sync_send_response(struct subscriber *dest, int forwards, uint64_t t if (rowid>max_token){ // a new bundle has been imported - rhizome_sync_bundle_inserted(bar); + if (!rhizome_is_bar_interesting(bar)) + rhizome_sync_bundle_inserted(bar); } if (count < max_count){