/** P2TP downloader. Params: root hash, filename, tracker ip/port, own ip/port */
int main (int argn, char** args) {
- srand(Datagram::Time());
+ srand(time(NULL));
FileTransfer::instance = rand();
if (argn<4) {
}
virtual bin64_t Pick (bins& offer, uint8_t layer) {
+ //dprintf("twist is %lli\n",twist_);
if (twist_) {
offer.twist(twist_);
ack_hint_out_.twist(twist_);
(ack_hint_out_,bin64_t::ALL,layer,bins::FILLED);
if (twist_) {
hint = hint.twisted(twist_);
- //dprintf("found twisted by %lli fixed to (%i,%lli)\n",
- // twist_,hint.layer(),hint.offset());
offer.twist(0);
ack_hint_out_.twist(0);
}
else
RecoverProgress();
picker_ = new SeqPiecePicker(this);
- picker_->Randomize(Datagram::Time()&7);
}
}
for(int i=0; i<peak_count_; i++)
hashes_[peaks_[i]] = peak_hashes_[i];
+ picker_->Randomize(rand()&31&(sizek_-1));
}