Commit graph

85 commits

Author SHA1 Message Date
SomberNight
1c75d939d9
commands: change API of "make_seed" and "create" commands
instead of "segwit" boolean, take a "seed_type" optional arg
default seed_type to "segwit"
previously these commands created legacy seeds by defalt
2019-08-09 22:02:01 +02:00
SomberNight
aadde9be17
transaction: fix remove_signatures
closes #5491
2019-07-05 21:16:58 +02:00
SomberNight
cc9ad3ae90
wallet: fix restore_wallet_from_text edge case
closes #5490
2019-07-05 19:27:44 +02:00
SomberNight
94b721baa4
wallet: fix type error in _bump_fee_through_decreasing_outputs
fixes #5483
2019-07-04 17:23:34 +02:00
SomberNight
e0b1bbfc46
tests: new tests for bump_fee and rbf_batching 2019-06-20 22:42:50 +02:00
SomberNight
0c20fcb6b3
tests: fix existing bump_fee tests 2019-06-20 22:42:49 +02:00
SomberNight
d0a43662bd
wallet: make "increase fee" RBF logic smarter
There are now two internal strategies to bump the fee of a txn.
bump fee method 1: keep all inputs, keep all not is_mine outputs,
                   allow adding new inputs
bump fee method 2: keep all inputs, no new inputs are added,
                   allow decreasing and removing outputs (change is decreased first)
Method 2 is less "safe" as it might end up decreasing e.g. a payment to a merchant;
but e.g. if the user has sent "Max" previously, this is the only way to RBF.

We try method 1 first, and fail-over to method 2.
Previous versions always used method 2.

fixes #3652
2019-06-20 22:42:48 +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
SomberNight
9e21b76c91
wallet: stricter validation in export_private_key
fixes #5422
2019-06-12 18:09:38 +02:00
SomberNight
53d189fc7a
storage: fix some madness about get_data_ref() and put() interacting badly
previously load_transactions() had to be called before upgrade();
now we reverse this order.

to reproduce/illustrate issue, before this commit:

try running convert_version_17 and convert_version_18
(e.g. see testcase test_upgrade_from_client_2_9_3_old_seeded_with_realistic_history)
and then in qt console:
>> wallet.storage.db.get_data_ref('spent_outpoints') == wallet.storage.db.spent_outpoints
False
>> wallet.storage.db.get_data_ref('verified_tx3') == wallet.storage.db.verified_tx
False
2019-06-06 19:49:06 +02:00
SomberNight
30ffb3d4dc
util: add function "chunks"
taken from ElectrumX
67111a3c4c/electrumx/lib/util.py (L149)
2019-05-26 04:10:32 +02:00
SomberNight
6ad24ea3b3
keystore/transactions: fix overflow of derivation path indices
fixes #5366
2019-05-21 02:14:22 +02:00
SomberNight
fd58a0cb20
json_db: enforce order of 'load_transactions' and 'upgrade'
fixes #5331
2019-05-13 19:21:26 +02:00
SomberNight
808239bbcc
wallet: fix deleting address from Imported_Wallet
closes #4481
2019-05-11 02:08:15 +02:00
SomberNight
07ec0d41d5
fix prev
unintentionally committed
2019-05-03 03:13:43 +02:00
SomberNight
fd5b1acdc8
commands: fix encrypt/decrypt
based on Electron-Cash/Electron-Cash@62aa08a0ff
2019-05-03 03:10:31 +02:00
SomberNight
7584cebbe3
bitcoin: stricter check on WIF for compressed pubkeys
fixes #5290
2019-04-25 14:35:16 +02:00
SomberNight
d4a2e9634f
bitcoin: disallow importing/sweeping segwit scripts with uncompressed pubkey
fixes #4638
2019-04-19 00:37:28 +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
9a71120090
blockchain: fix bug when swapping chain with parent
chain might become the parent of some of its former siblings
2019-03-26 20:55:27 +01:00
SomberNight
eb04551f9a
accept base43-encoded tx in Qt "Load transaction"
When encoding transactions as QR codes, we encode the tx bytes as base43
first. This makes it easier to load a transaction if the user manually
decodes the QR code.
2019-03-05 17:27:53 +01:00
SomberNight
94c4cb44d7
fix storage upgrade tests: "fixture 'func' not found" 2019-03-01 21:02:10 +01:00
SomberNight
9ecb504739
storage: fix convert_version_17 and add new test case
follow-up 121b8048b0
2019-03-01 19:46:23 +01:00
SomberNight
f85b8f349d
wallet: fix bug in restore_wallet_from_text, and write tests 2019-02-28 20:26:29 +01:00
ThomasV
d74f0c0947 storage_db: fix tests, add modified flag to db class 2019-02-28 12:09:36 +01:00
ThomasV
dbca0a0e83 fix tests for json storage 2019-02-28 10:37:48 +01:00
ThomasV
7f2083f667 separate storage and database (JsonDB) 2019-02-28 09:02:58 +01:00
SomberNight
a2047e2c68
tests: base43/base58 encoding/decoding 2019-02-25 19:17:38 +01:00
SomberNight
11733d6bc2
wizard: normalize bip32 derivation path
so that what gets put in storage is "canonical"
(from now on... we could storage upgrade existing wallets
but it's not critical)
2019-02-22 18:50:29 +01:00
SomberNight
85a7aa291e
bip32: refactor whole module. clean-up. 2019-02-22 18:50:24 +01:00
SomberNight
b39c51adf7
mv "electrum seed" stuff from bitcoin.py to mnemonic.py 2019-02-22 18:01:54 +01:00
SomberNight
e7f38467d7
move opcodes to bitcoin.py 2019-02-22 17:39:58 +01:00
SomberNight
38ab7ee554
network: catch untrusted exceptions from server in public methods
and re-raise a wrapper exception (that retains the original exc in a field)

closes #5111
2019-02-12 17:02:15 +01:00
SomberNight
d820f9ad37
transaction: change default version to 2 2019-01-28 15:11:03 +01:00
SomberNight
5fc715cdee
commands: add convert_xkey for converting between {x,y,z}|{pub,prv} 2019-01-20 15:49:42 +01:00
ghost43
dc19cf1fa1
wallet: randomise locktime of transactions a bit. also check if stale. (#4967) 2019-01-16 18:51:59 +01:00
ghost43
8e5331e5b2
Merge pull request #4932 from SomberNight/revealer_cleanup_20181215
revealer: clean-up, allow restoring v0
2018-12-20 04:24:21 +01:00
SomberNight
0c9a03ac54
keystore: revert KDF change from #4838
making the KDF expensive is blocked on #4909
2018-12-18 15:37:29 +01:00
SomberNight
e7e9f8e7f2
revealer: fix unlucky hex seed causing crash 2018-12-15 09:05:12 +01:00
SomberNight
f969edcf50
revealer: split some core parts out into separate file
for easier testing
2018-12-15 08:52:00 +01:00
SomberNight
0657bb1b36
test_wallet_vertical: add segwit 2fa test 2018-12-14 23:01:52 +01:00
SomberNight
8b775fd24a
contrib: import 'requests' in try-except 2018-12-13 23:25:52 +01:00
ThomasV
df59a43300 fix test 2018-12-11 09:28:35 +01:00
ThomasV
5a93bf054e 2fa segwit (from ghost43's PR) 2018-12-11 09:28:35 +01:00
SomberNight
c017f788ac
wallet: TxMinedInfo (merged TxMinedStatus and VerifiedTxInfo) 2018-12-07 20:47:28 +01:00
SomberNight
e8a8a17217
test_wallet_vertical: offline sign with old seed 2018-12-05 18:55:19 +01:00
ThomasV
2484c52611
Merge pull request #4838 from SomberNight/keystore_pw_hash2b
keystore: stronger pbkdf for encryption
2018-11-30 11:48:03 +01:00
ThomasV
d062548e41
Merge pull request #4861 from SomberNight/blockchain_fork_ids
blockchain: generalise fork handling and follow most work chain
2018-11-28 12:54:57 +01:00
Janus
37b009a342 qt history view custom fiat input fixes
previously, when you submitted a fiat value with thousands separator,
it would be discarded.
2018-11-27 17:00:26 +01:00
SomberNight
141ff99580
blockchain.py: generalise fork ids to get rid of conflicts 2018-11-22 16:57:22 +01:00