Commit Graph

58 Commits

Author SHA1 Message Date
Neil Booth
b8fc739590 Fix ordering in get_utxos 2016-11-27 21:54:05 +09:00
Neil Booth
6aef79461f Don't shut down block processor by cancellation
The block processor needs to be able to close cleanly, and not
mid-block.  In order to be able to yield whilst processing blocks
we cannot forcefully close its coroutine with a cancellation.
2016-11-27 12:20:16 +09:00
Neil Booth
1b95bcd8ac Open DB differently depending on if syncing
If syncing, use a high max_open_files, otherwise lower it.
2016-11-27 07:25:28 +09:00
Neil Booth
95a2de6dae Move DB undo code to db.py 2016-11-26 13:18:10 +09:00
Neil Booth
8d253c81d3 Move clean_db() to db.py 2016-11-26 13:15:45 +09:00
Neil Booth
59244cc24e Move bulk of FS flush code to db.py
More logically belongs there.
Have servers use the flushed DB height not the block processor's height.
Get all headers only from disk.
2016-11-26 13:11:59 +09:00
Neil Booth
59733e4609 Move bitcoin-specific coin defaults to Bitcoin 2016-11-26 08:32:30 +09:00
TheLazieR Yip
e987510432 Replace double_sha256 with header_hash from coin 2016-11-25 07:25:57 -05:00
Neil Booth
aa9f106865 Add missing self; use max_secs where intended. 2016-11-20 23:11:35 +09:00
Neil Booth
8617c82ec2 Floor disk_count at zero. 2016-11-19 20:56:08 +09:00
Neil Booth
3d87e299ea Move formatted_time to library 2016-11-19 15:42:06 +09:00
Neil Booth
ffd6cd63b0 Fix thinko 2016-11-19 08:16:20 +09:00
Neil Booth
d6fa4a1564 More logging improvements
- log software and DB version at startup
- log more DB info at startup
- log software and DB version when first synced

Fixes #29
2016-11-19 07:29:17 +09:00
Neil Booth
f4651c0ca4 Store tx_num in 'h' table key so keys are unique 2016-11-17 07:59:40 +09:00
Neil Booth
c5c7b6f438 Have all expensive requests yield. 2016-11-17 06:50:46 +09:00
Neil Booth
85786b87a2 Save all UTXOs
Change the DB version
2016-11-13 20:35:03 +09:00
Neil Booth
1b9a9b8927 Start saving DB version and checking it 2016-11-12 07:31:56 +09:00
Neil Booth
f98dc9c351 Practise optimism like before 2016-11-11 21:03:09 +09:00
Neil Booth
311f7f9ffd Better optimised storage of UTXO set 2016-11-10 20:04:33 +09:00
Neil Booth
094fd44fc2 Merge UTXO cache into BlockProcessor 2016-11-10 07:49:01 +09:00
Neil Booth
06b6d695c2 Only attempt to flush if cancelled 2016-11-10 07:32:39 +09:00
Neil Booth
3972e18e98 Move the rest of fs_cache into BlockProcessor 2016-11-08 23:30:30 +09:00
Neil Booth
ad2dabf751 Remove the FS cache
Really belongs with BlockProcessor now
2016-11-08 20:06:06 +09:00
Neil Booth
5736e9cb70 Move utxo_cache to BlockProcessor where it belongs 2016-11-08 19:35:21 +09:00
Neil Booth
5c5e90d574 Move BlockServer to more appropriate location 2016-11-08 19:20:13 +09:00
Neil Booth
93d53bdd87 The controller is dead! 2016-11-08 08:29:56 +09:00
Neil Booth
c0a112f8ea Split out part of block processor into db.py
The part that doesn't actually do any block processing...
2016-11-08 07:38:16 +09:00
Neil Booth
c008c04e43 Move caches to their own file.
Move the DB to the block_processor file.  It will merge with it soon.
2016-10-27 07:58:00 +09:00
Neil Booth
30d1b7f77c Add proper block chaining check 2016-10-27 07:38:39 +09:00
Neil Booth
78d0acc95b Fix get_tx_hash 2016-10-27 07:33:21 +09:00
Neil Booth
28eb95edd3 Break out FS cache into its own class 2016-10-27 07:30:24 +09:00
Neil Booth
334ffdaa4f Begin work on proper server 2016-10-17 20:02:42 +09:00
Neil Booth
c8f3c79167 Memory views for blocks don't seem to help 2016-10-16 09:08:38 +09:00
Neil Booth
19cbb2d00d Fix ETA estimate 2016-10-15 12:43:23 +09:00
Neil Booth
282d46a46c Flush to disk when flushing history 2016-10-15 11:41:55 +09:00
Neil Booth
34096a02e9 Recovery from excess history flushes 2016-10-15 08:42:42 +09:00
Neil Booth
cbe1ef60ca Better logging 2016-10-14 20:26:10 +09:00
Neil Booth
5f77ff4ef0 Flush history separately.
We do not yet remove excess history.
2016-10-14 20:09:47 +09:00
Neil Booth
6b513a91d0 CACHE_MB is now the environment var. 2016-10-14 07:56:25 +09:00
Neil Booth
4b99ae4e11 Fix ETA calc 2016-10-13 07:16:42 +09:00
Neil Booth
3fce298835 Better time est. A couple of fixes. 2016-10-12 18:59:15 +09:00
Neil Booth
5653bf75f5 More robust init 2016-10-12 05:38:24 +09:00
Neil Booth
ba1662bbf7 Add ETA stats. Show daemon height again. 2016-10-11 21:45:48 +09:00
Neil Booth
c7f930a18a Clean up db initialization and state writing 2016-10-11 21:20:04 +09:00
Neil Booth
d8e9eb7796 Accurate cache accounting 2016-10-11 17:38:03 +09:00
Neil Booth
682cc8ff86 Better size est. 2016-10-11 06:49:50 +09:00
Neil Booth
d11c60f6ad Cache size logging 2016-10-11 06:43:59 +09:00
Neil Booth
14f4228af7 Add missing line 2016-10-11 00:11:10 +09:00
Neil Booth
4e777b5861 Let's try a smarter UTXO cache. 2016-10-11 00:04:13 +09:00
Neil Booth
6644102441 Use hash168 to distinguish address types in DB 2016-10-10 11:42:33 +09:00