Miguel Freitas
6b01734ccf
fix segfault in dhtget when ses is NULL ( http://pastebin.com/rcJQm48W )
2014-01-09 14:48:42 -02:00
Miguel Freitas
5ab658ae3d
enforce bencoded size. sanity check.
2014-01-07 16:51:40 -02:00
Miguel Freitas
8e80324c36
try to reduce the level of useless dht tracker requests by not announcing empty torrents we do not follow.
2014-01-06 21:59:40 -02:00
Miguel Freitas
8287b2b1e1
use a single database for all swarms of the same libtorrent session.
...
upgrade resume file to version 2 and enforce on loading (to force existing clients to download all pieces again).
fixes #24 .
2014-01-06 15:10:32 -02:00
toyg
83dcd048bb
fixes to compile and run under OSX 10.9.1
2014-01-02 23:10:57 +00:00
Miguel Freitas
6708cec239
report dht_global_nodes in getinfo
2013-12-31 09:46:19 -02:00
Miguel Freitas
884e25eecc
prevent useless dhtget (for neighbor check) when torrent is already known
2013-12-30 12:24:29 -02:00
Miguel Freitas
60db413630
less noisy
2013-12-30 12:14:03 -02:00
Miguel Freitas
378e4622e3
make it 2h before blockchain is considered outdated
2013-12-17 08:08:16 -02:00
Miguel Freitas
36da093939
recheckusertorrent rpc
2013-11-23 18:25:55 -02:00
Miguel Freitas
dd128a39a1
Merge ../twister-bare
2013-11-23 13:09:16 -02:00
Miguel Freitas
b4d044f843
utf8 character counting to check message size < 140
2013-11-23 13:06:28 -02:00
Miguel Freitas
0903a9e0ec
fix bug where "follow" failed for empty users (who followed no one)
2013-11-23 10:05:15 -02:00
Miguel Freitas
bc990abfff
"hexcape" binary strings before json encoding.
...
because json doesn't support binary we need to escape to hex, unfortunatly,
this add requirement to twisterd to know each possible binary field we may add to dht items.
(unlike bencode that simply doesn't care).
2013-11-22 17:33:07 -02:00
Miguel Freitas
408fec30ed
periodically save user_data
2013-11-18 18:01:30 -02:00
Miguel Freitas
570d9196a2
reordering direct messages by time is only allowed when both messages have been received (not fromMe).
...
otherwise we would be comparing times from different computers, which may cause messages to get out of order.
2013-11-18 13:54:07 -02:00
Miguel Freitas
37aa4f1827
rework locking in getinfo to fix deadlock
2013-11-18 10:51:23 -02:00
Miguel Freitas
78f3ceb921
reduce contention with mutex cs_twister
2013-11-17 23:43:54 -02:00
Miguel Freitas
fb0802449c
implement index of partial usernames so search-as-you-type can work as expected with listusernamespartial
2013-11-17 22:56:06 -02:00
Miguel Freitas
f4d6c2be28
getnumpieces rpc
2013-11-14 16:17:06 -02:00
Miguel Freitas
ba0b4c8613
avoid adding the same nodes to dht subsys all the time
2013-11-14 15:07:47 -02:00
Miguel Freitas
a2c87535c0
periodically save resume data. if daemon crashes we don't lose everything.
2013-11-10 00:03:24 -02:00
Miguel Freitas
c035fc8371
Merge
2013-11-08 00:37:15 -02:00
Miguel Freitas
6d7e895d7c
finer locking to fix another deadlock case
2013-11-08 00:36:49 -02:00
Miguel Freitas
57eeb6d73b
more hashtags separators and tolower
2013-11-07 17:38:21 -02:00
Miguel Freitas
c3bea0a3dd
If bitcoin network goes down, pause libtorrent to prevent pieces being falsely rejected because height > bestHeight.
...
Also, if bitcoin network is down, try to add nodes from DHT bucket tables back to the bitcoin network.
2013-11-07 15:06:06 -02:00
Miguel Freitas
26778c1ff1
fix another deadlock
2013-11-06 16:19:43 -02:00
Miguel Freitas
2c256b6edb
implement piece verification using old signatures. now i can reenable banning peers due to bad pieces.
2013-11-06 09:22:05 -02:00
Miguel Freitas
f81088be70
properly implement verification using keys that have been replaced.
...
the basic idea is replace txIndex key with a pair (username,height).
height = -1 for the most up-to-date key, otherwise height = last block where previous key was valid.
by checking maxHeight and iterating backwards we can easily find the key to validate data from any given block number.
2013-11-05 00:00:11 -02:00
Miguel Freitas
a4695ba9e1
delay libtorrent initialization until we have valid blocks
2013-11-04 19:55:59 -02:00
Miguel Freitas
22161a71ed
fix deadlock
2013-11-01 15:13:37 -02:00
Miguel Freitas
8286e4c78d
old debug printf
2013-10-31 14:24:04 -02:00
Miguel Freitas
2df6ff2420
persist spammsg to send and generate status
2013-10-30 21:19:14 -02:00
Miguel Freitas
3ac54ffbe9
don't start torrent for nonexistent users. (we will need something different for #hashtags)
2013-10-30 20:57:49 -02:00
Miguel Freitas
432535bd6d
fix listusernamespartial: search string must be shorter than username being compared (or equal). not longer.
2013-10-30 17:31:30 -02:00
Miguel Freitas
6ade53ce53
implement new rpc dumppubkey.
...
importprivkey now verifies if username exists in txdb
2013-10-29 17:54:23 -02:00
Miguel Freitas
549ba353dd
yet another ThreadMaintainDHTNodes heuristic improvement
2013-10-29 10:48:06 -02:00
Miguel Freitas
3c90b0a94c
rt also updates status
2013-10-28 23:51:11 -02:00
Miguel Freitas
dbc640faaa
implement exact match on username search
2013-10-28 23:30:18 -02:00
Miguel Freitas
d16d50313a
insert directmsgs into vector ordered by time
2013-10-28 23:15:19 -02:00
Miguel Freitas
2cd0b0a881
rescandirectmsgs: rescan all streams of users we follow for new and old directmessages
2013-10-28 22:59:43 -02:00
Miguel Freitas
d9c64c2076
another try at ThreadMaintainDHTNodes to fix the problem of adding useless dht nodes and forcing announcements all the time.
2013-10-28 19:45:01 -02:00
Miguel Freitas
a7f7b45976
remove test code
2013-10-26 16:16:07 -02:00
Miguel Freitas
1d78f7ec27
improve dht resource expiration policy (still not enabled)
2013-10-26 16:00:16 -02:00
Miguel Freitas
3e64454b7d
Save lastk field to post so torrent-less navigation through posts is possible. => DONE
2013-10-26 13:42:50 -02:00
Miguel Freitas
d14dca10e1
disable libtorrent read cache cause i've messed up something
2013-10-25 23:44:08 -02:00
Miguel Freitas
55b3f62872
fix previous commit: don't clear spammsg if it is not consumed.
2013-10-22 19:55:23 -02:00
Miguel Freitas
552b7b542d
persist some global config. now we implement a spam policy max 1 every 8 hours (not cumulative).
2013-10-22 19:51:18 -02:00
Miguel Freitas
6cb5364605
disable printf of dm's
2013-10-22 18:31:54 -02:00
Miguel Freitas
7e1726ba8c
implement expiring dht items (but it is not enabled yet)
2013-10-18 12:08:54 -03:00