Commit graph

61 commits

Author SHA1 Message Date
SomberNight
06cff9ac10
logging: fix call with multiple args 2019-05-06 23:03:19 +02:00
SomberNight
3385a94753
logging: basics 2019-05-02 15:19:03 +02:00
SomberNight
bca6ad5241
verifier: fix logic bug. after reorg, some verifs were not undone
after a reorg, in a many fork/orphan chains scenario,
we would sometimes not undo SPV for enough blocks

functions in blockchain.py somewhat based on kyuupichan/bitcoinX@5126bd15ef
2019-03-26 21:01:43 +01:00
SomberNight
752c518bdc
add option to freeze individual UTXOs
based on cculianu's work in Electron-Cash/Electron-Cash@fd910cffc8
2019-03-11 18:46:29 +01:00
SomberNight
cd40f2c9b7
trivial wallet clean-up 2019-03-10 18:47:23 +01:00
SomberNight
2abc4f6334
wallet: cache get_addr_balance
notably this makes get_history faster; as 40% of the time is spent in
get_addr_balance (without the cache)
2019-03-04 22:19:33 +01:00
SomberNight
514d0ae958
wallet: towards restoring previous performance 2 2019-03-04 18:16:48 +01:00
SomberNight
ef1330df5d
[trivial] use namedtuple field by name 2019-03-03 17:34:03 +01:00
SomberNight
2ad73050b3
wallet: towards restoring previous performance 2019-03-01 17:59:22 +01:00
ThomasV
1e519f2dd0 json_db: make get operations threadsafe 2019-02-28 15:47:42 +01:00
ThomasV
d74f0c0947 storage_db: fix tests, add modified flag to db class 2019-02-28 12:09:36 +01:00
SomberNight
4b36114d0d small fixups 2019-02-28 09:02:58 +01:00
ThomasV
791e680a96 abstract database away from wallet and address_synchronizer 2019-02-28 09:02:58 +01:00
SomberNight
40bf049c82
commands: introduce 'removelocaltx'
see #5137
2019-02-20 18:01:43 +01:00
SomberNight
8e6904c7b7
wallet: default to get_addresses() in get_history()
get_addresses() is a superset of history.keys()
(was missing some local transactions in the output of get_history())
2019-02-20 17:52:43 +01:00
SomberNight
9bbea9bf2f
wallet: implement wait_for_address_history_to_change API 2019-01-30 21:30:25 +01:00
SomberNight
7ffd928e80
wallet: add comment 2019-01-17 17:19:08 +01:00
SomberNight
c9482b5ea2
fix prev 2018-12-07 20:59:19 +01:00
SomberNight
c017f788ac
wallet: TxMinedInfo (merged TxMinedStatus and VerifiedTxInfo) 2018-12-07 20:47:28 +01:00
SomberNight
960855d0aa
wallet history fees: only calculate fees when exporting history
it's expensive, and it slows down startup of large wallets a lot
2018-12-04 16:17:22 +01:00
SomberNight
e12af33626
wallet: cache more in get_tx_fee
closes #4879
2018-11-28 12:35:53 +01:00
SomberNight
5376d37c24
history export: include tx fee
closes #3504
2018-11-18 16:46:07 +01:00
SomberNight
71ac3bb305
RBF batching: some fixes 2018-11-09 17:56:42 +01:00
ThomasV
2b8d801b36 if possible, batch new transaction with existing rbf transaction 2018-11-09 16:33:29 +01:00
SomberNight
99d18a48f2
types: make some import conditional 2018-10-25 23:01:53 +02:00
SomberNight
81cc20039e
more type annotations in core lib 2018-10-22 16:41:25 +02:00
SomberNight
10a4c7a6ed
wallet.mktx: add new args: rbf, nonlocal_only
used on lightning branch
2018-10-19 20:48:48 +02:00
SomberNight
e3b372946a
rm aiosafe decorator. instead: log_exceptions and ignore_exceptions 2018-10-12 18:36:48 +02:00
SomberNight
02f108d927
restructure synchronizer
fix CLI notify cmd. fix merchant websockets.
2018-10-03 17:13:46 +02:00
SomberNight
4d43d12abf
transaction: don't convert p2pk to p2pkh address when displaying
also closes #4742
2018-10-01 04:58:26 +02:00
SomberNight
96b699e534
synchronizer: fix refresh bug 2018-09-19 16:35:30 +02:00
SomberNight
fef15f9c02
wallet: minor opt in get_history 2018-09-18 16:41:56 +02:00
SomberNight
01246b0d97
wallet/verifier: when adding into unverified_tx, don't remove from verifier
Not needed since aee2d8e120
And was never really working I guess (race..)
Also, during normal initial history sync, it caused the verifier to request
proofs multiple times.
2018-09-18 03:48:14 +02:00
SomberNight
c8f82c71c9
wallet: small perf optimisation in add_transaction 2018-09-18 02:14:23 +02:00
SomberNight
11bf084a1f
network triggers: 'verified' notification now includes wallet
this is a performance optimisation.

measurements using a large wallet with 11k txns:
syncing XPUB for the first time takes 10 seconds. leaving window open, and
syncing same XPUB again in new window takes 30 seconds. in third window,
it takes ~50 seconds. then ~70s. presumably scaling linearly.
this is due to the history_list.update_item call being CPU-heavy.
now all of them take 10 seconds.
2018-09-18 01:40:34 +02:00
SomberNight
435efb47d0
wallet: lock in get_addr_io, get_tx_delta, get_tx_value
probably fixes #4716
2018-09-17 18:50:47 +02:00
SomberNight
aee2d8e120
verifier: fix a race during reorgs
related: 41e088693d
If our guess of a txn getting confirmed at the same height in the new chain
as it was at in the old chain is incorrect, there is a race between the
verifier and the synchronizer. If the verifier wins, the exception will cause
us to disconnect.
2018-09-17 03:35:25 +02:00
SomberNight
e7fa42ce3e
wallet: don't write to disk when switching servers 2018-09-12 20:25:13 +02:00
SomberNight
47a97279af
rename CustomTaskGroup to SilentTaskGroup 2018-09-12 19:24:58 +02:00
SomberNight
e829d6bbcf
wallet: put Sync and Verifier in their own TaskGroup, and that into interface.group 2018-09-11 20:24:01 +02:00
SomberNight
136df7e5ee
wallet: recreate Synchronizer and Verifier when switching servers
not that nice but solves races
2018-09-08 01:34:33 +02:00
SomberNight
26172686b8
restructure synchronizer/verifier <--> interface coupling 2018-09-07 19:34:28 +02:00
SomberNight
4d95452ae7
wallet: partial fix for race in on_default_server_changed 2018-09-06 14:17:44 +02:00
Janus
c89020725b
address synchronizer: fetch initial addresses from wallet 2018-09-06 14:17:43 +02:00
Janus
8f36c9167d
aiorpcx: remove callback based code, add session to Interface 2018-09-06 14:17:29 +02:00
Janus
b120584f97
aiorpcx address synchronizer 2018-09-06 14:11:36 +02:00
Janus
97ea0fc439
aiorpcx: replace network loop with asyncio and try to maintain ten sessions 2018-09-06 14:11:20 +02:00
SomberNight
1e3c3a528c
attempt at fixing wallet syncing crash
fix #3998
fix #4689
2018-09-05 15:22:57 +02:00
SomberNight
3089edd3a2
wallet: remove method get_num_tx 2018-08-14 21:54:11 +02:00
SomberNight
f7166e95c4
wallet: move get_depending_transactions to AddressSynchronizer
and resolve TODO
2018-08-14 21:53:05 +02:00