1
0
Commit Graph

113 Commits

Author SHA1 Message Date
SomberNight
3c019c2f9c daemon/wallet/network: make stop() methods async 2021-03-09 17:52:36 +01:00
SomberNight
859f8ccf8e fix wallet.clear_history()
it would result in "wallet.get_history() failed balance sanity-check"

maybe related: https://github.com/spesmilo/electrum/issues/6792
2021-03-04 14:25:41 +01:00
SomberNight
c4e9afa019 wallet.remove_transaction: also rm dependent/child txs
Main motivation is that I often use wallet.remove_transaction
from the Qt console, and would find this behaviour more intuitive.
Note that previously if one were to call this on a tx with children,
the crash reporter would appear with "wallet.get_history() failed balance sanity-check".

related: https://github.com/spesmilo/electrum/issues/6960#issuecomment-764716533
2021-01-21 18:05:48 +01:00
SomberNight
8ac6d3b17d wallet.get_history: take locks.
Re the check at the end: "history not synchronized" - it's not that it's not synchronized,
rather that the history is changing while being computed.
2020-10-18 22:21:06 +02:00
SomberNight
777095fda8 wallet: simplify get_history
some years ago wallet.get_tx_delta returned Optional[int] but it returns int now
2020-10-18 22:14:52 +02:00
SomberNight
f125a06453 wallet: simplify get_wallet_delta 2020-10-18 20:37:29 +02:00
SomberNight
da6080421e wallet_db: WalletDB.get_txo_addr now returns dict instead of list 2020-10-18 20:37:25 +02:00
SomberNight
e71fa4924f wallet: rm wallet.txin_value 2020-10-18 20:37:21 +02:00
SomberNight
8b2eb83238 wallet: use get_txin_value in get_wallet_delta 2020-10-18 20:37:18 +02:00
SomberNight
55b5335ebb qt tx dialog: always show input amounts if we know them
Previously we would only show input amounts for partial txs.
Now also show them for complete txs as well, if we know them:
we check in the wallet db for the prevtx and read the value for the output.
This is safe as the input commits to the prevout via txid (which commits to the output value).

Also show "from addresses" in more cases in a similar fashion.
2020-10-18 20:37:14 +02:00
SomberNight
772199a766 wallet: fix clear_history 2020-10-09 16:22:59 +02:00
SomberNight
ea3e3ddbb8 lnpeer: handle cooperative close edge-case
fix #6317
2020-09-13 16:55:37 +02:00
SomberNight
a1baf860b6 wallet.set_up_to_date: (trivial) reduce log spam 2020-07-15 23:50:26 +02:00
ThomasV
04fb329c2e swaps: stop watching address once utxo is spent and mined 2020-06-18 14:28:40 +02:00
SomberNight
2b1a150c52 multi-wallet: properly stop lnworker/lnwatcher 2020-05-01 04:50:08 +02:00
ThomasV
9224404108 Move callback manager out of Network class 2020-04-14 18:29:51 +02:00
ThomasV
99f933401a add more logging shortcuts 2020-04-12 12:30:59 +02:00
SomberNight
900a7631cf commands: add new cmd "getprivatekeyforpath" to export a WIF for a path
related: #6061
2020-03-31 05:50:18 +02:00
SomberNight
7a574c3cbc wallet/GUI: don't allow "removing" a LN force-close-tx from history 2020-03-02 05:11:08 +01:00
SomberNight
d8180c678b Qt addresses list: show derivation path in tooltip (also addr dialog)
related: #5641
2020-03-01 05:45:15 +01:00
SomberNight
4a8ee1818a follow-up prev
E/W | lnwatcher.LNWalletWatcher | Exception in on_network_update: AssertionError('None')
Traceback (most recent call last):
  File "...\electrum\electrum\util.py", line 1035, in wrapper
    return await func(*args, **kwargs)
  File "...\electrum\electrum\lnwatcher.py", line 174, in on_network_update
    await self.check_onchain_situation(address, outpoint)
  File "...\electrum\electrum\lnwatcher.py", line 184, in check_onchain_situation
    closing_height = self.get_tx_height(closing_txid)
  File "...\electrum\electrum\address_synchronizer.py", line 597, in get_tx_height
    verified_tx_mined_info = self.db.get_verified_tx(tx_hash)
  File "...\electrum\electrum\json_db.py", line 44, in wrapper
    return func(self, *args, **kwargs)
  File "...\electrum\electrum\wallet_db.py", line 859, in get_verified_tx
    assert isinstance(txid, str), f"{repr(txid)}"
AssertionError: None
2020-02-24 18:52:33 +01:00
ThomasV
9616333b39 add_future_tx should return success 2020-02-22 17:20:05 +01:00
SomberNight
0d33da2f95 wallet: (sanity) is_mine now guaranteed to handle 'None' input 2020-02-12 18:14:04 +01:00
SomberNight
d2f132738a wallet: only select mature coins by default
this is a regression from #5721

Removed the `TxInput.is_coinbase` method as I think it is a confusing API,
instead we now have `TxInput.is_coinbase_input` and `TxInput.is_coinbase_output`.

related #5872
2020-01-02 00:43:49 +01:00
SomberNight
30dcab0877 wallet: allow saving partial txns as local (but require txid) 2019-12-08 04:32:44 +01:00
SomberNight
8e89c0c971 wallet: some clean-up re get_address_history vs db.get_addr_history
note: tests needed changing due to behavioural change in wallet.get_receiving_address()
Previously wallet.get_receiving_address used wallet.db.get_addr_history,
now it (indirectly) uses wallet.get_address_history, which now also considers local txns.
2019-12-07 05:42:28 +01:00
SomberNight
8dbbc21aff wallet: better (outgoing) invoice "paid" detection
- no more passing around "invoice" in GUIs, invoice "paid" detection is now handled by wallet logic
- a tx can now pay for multiple invoices
- an invoice can now be paid by multiple txs (through partial payments)
- new data structure in storage: prevouts_by_scripthash
  - type: scripthash -> set of (outpoint, value)
  - also, storage upgrade to build this for existing wallets
2019-11-29 15:06:16 +01:00
SomberNight
557987d4eb add/fix some open_channel related type hints 2019-11-23 20:28:46 +01:00
ThomasV
06589df812 simplify add_transaction 2019-11-23 12:46:43 +01:00
SomberNight
6b195437ed wallet: "future" txns num conf is now negative
flipped the sign so that TxMinedInfo.conf can be consistently used in inequalities
2019-11-21 05:01:59 +01:00
SomberNight
8a7c3447b3 tx dialog: try harder to show fee 2019-11-07 02:24:16 +01:00
SomberNight
bafe8a2fff integrate PSBT support natively. WIP 2019-11-04 22:24:36 +01:00
SomberNight
6a32187f01 qt: fix address dialog
(was showing full history, not just for addr)
2019-09-21 18:48:44 +02:00
ThomasV
7b828359c6 simplify get_tx_fee 2019-09-12 12:26:49 +02:00
SomberNight
482605edbb wallet: organise get_tx_fee. store calculated fees. storage version 19. 2019-09-12 08:59:27 +02:00
SomberNight
b138fff9a5 wallet: txi/txo small clean-up 2019-09-12 04:07:17 +02:00
SomberNight
241873f0a4 address_synchronizer.get_history now returns HistoryItem(NamedTuple)s 2019-09-12 04:06:51 +02:00
ThomasV
65b88dca86 return fees in history, show them in kivy GUI 2019-09-11 17:49:40 +02:00
SomberNight
d1dea9343e wallet: address_is_old minor clean-up
also, synchronize was defined twice in AddressSynchronizer
2019-09-09 01:34:29 +02:00
SomberNight
abde8ff169 wallet: fix maturity off-by-one
based on Electron-Cash/Electron-Cash@c70957eb13
2019-09-08 18:26:04 +02:00
SomberNight
ab76a1fe5b wallet.add_hw_info: also store "is_change" in output_info
as it seems every consumer wants to know this and has its own hacks to
figure it out
2019-09-03 14:34:10 +02:00
ThomasV
7a51f034e4 add future transactions to address synchronizer 2019-08-20 09:03:11 +02:00
Janus
261fefb6f3 lnwatcher rebased 2019-08-20 09:03:10 +02:00
SomberNight
66817d41f9 lnwatcher improvements
- only try sweeping csv-locked to_local if past timelock
- check if outputs are already spent
- no need to keep watching channels for which all outputs are spent and mined deep
2019-08-20 09:03:10 +02:00
SomberNight
7ba3f2d54d calc short_channel_id after funding locked 2019-08-20 09:03:09 +02:00
Janus
9617447a0f lnbase: add lnbase_test 2019-08-20 09:03:09 +02:00
SomberNight
e431a07258 fix prev: conditional import / type hint failure 2019-07-03 13:56:11 +02:00
SomberNight
d293b2e038 wallet: follow-up prev 2019-07-03 13:40:42 +02:00
ThomasV
37e7add776 Do not pass storage to address_synchronizer 2019-07-03 10:46:30 +02:00
SomberNight
e3c26d7c7a json_db: fix remove_spent_outpoint
method should make sure prevout_n is str...
also wrote failing test
2019-06-15 03:51:11 +02:00