@@ -97,6 +97,25 @@ namespace DHT {
97
97
sig = sign.bytes ;
98
98
}
99
99
100
+ void put_signed_bytes
101
+ (
102
+ libtorrent::entry& e
103
+ ,std::array<char , 64 >& sig
104
+ ,std::int64_t & seq
105
+ ,std::string const & salt
106
+ ,std::array<char , 32 > const & pk
107
+ ,std::array<char , 64 > const & signature
108
+ ,libtorrent::entry const & entry
109
+ ,std::int64_t const & iSeq
110
+ )
111
+ {
112
+ using dht::sign_mutable_item;
113
+ e = entry;
114
+ seq = iSeq;
115
+ sig = signature;
116
+ LogPrintf (" %s --\n Salt = %s\n Sequence = %d, e = %s\n " , __func__, salt, seq, e.to_string ());
117
+ }
118
+
100
119
void CleanUpPutBuffer ()
101
120
{
102
121
uint32_t nCurrentTimeStamp = GetAdjustedTime ();
@@ -249,7 +268,12 @@ void ReannounceEntries()
249
268
if (randomMutableItem.vchSalt .size () > 0 && ConvertMutableEntry (randomMutableItem, mut_item)) {
250
269
size_t thread = fMultiThreads ? nThreads -1 : 0 ;
251
270
libtorrent::sha1_hash infohash (randomMutableItem.InfoHash ().c_str ());
252
- arraySessions[thread].second ->Session ->dht_put_item (mut_item);
271
+ std::array<char , ED25519_PUBLIC_KEY_BYTE_LENGTH> pubkey;
272
+ aux::from_hex (randomMutableItem.PublicKey (), pubkey.data ());
273
+ std::array<char , ED25519_SIGTATURE_BYTE_LENGTH> signature_bytes;
274
+ aux::from_hex (randomMutableItem.Signature (), signature_bytes.data ());
275
+ arraySessions[thread].second ->Session ->dht_put_item (pubkey, std::bind (&DHT::put_signed_bytes, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4,
276
+ pubkey, signature_bytes, mut_item, randomMutableItem.SequenceNumber ), randomMutableItem.Salt ());
253
277
LogPrintf (" %s -- Re-annoucing item infohash %s, entry \n %s\n " , __func__, infohash.to_string (), mut_item.to_string ());
254
278
}
255
279
}
0 commit comments