Commit graph

388 commits

Author SHA1 Message Date
Janus
097ac144d9 file reorganization with top-level module 2018-07-13 14:01:37 +02:00
Janus Troelsen
4f85615734 add simnet support (#4455) 2018-06-22 17:07:07 +02:00
ghost43
a98e833897
getfeerate command: add optional parameters to specify custom fee level (#4264) 2018-06-15 17:02:44 +02:00
Harm Aarts
e57e55aad8 Remove explicit send calls, part deux (#4408)
* Rename synchronous_get to synchronous_send

This makes it more inline with the method 'send' of which
synchronous_send is the, well, synchronous version.

* Move protocol strings from scripts to network

This is again a small step in the right direction. The network module is
going to accumulate more and more of these simple methods. Once
everything is moved into that module, that module is going to be split.

Note that I've left the scripts which use scripts/util.py alone. I
suspect the same functionality can be reached when using just
lib/network.py and that scripts/util.py is obsolete.

* Remove protocol string from verifier and websocket

Websocket still has some references, that'll take more work to remove. Once the
network module has been split this should be easy.
I took the liberty to rename a variable to better show what it is.

* Remove protocol strings from remainder

The naming scheme I'm following for the newly introduced methods in the network
module is: 'blockchain.<subject>.<action>' -> def <action>_(for|to)_<subject>

* Move explicit protocol calls closer to each other

This makes it easier to keep track of the methods which are due to be
extracted.

* Remove `send` when using `get_transaction`

This is the final step to formalize (the informal) interface of the network
module.
A chance of note is changed interface for async/sync calls. It is no longer
required to use the `synchronous_send` call. Merely NOT passing a callback
makes the call synchronous. I feel this makes the API more intuitive to work
with and easier to replace with a different network module.

* Remove send from get_merkle_for_transaction

The pattern which emerged for calling the lambda yielded an slight refactor.
I'm not happy with the name for the `__invoke` method.

* Remove explict send from websockets

* Remove explicit send from scripts

* Remove explicit send from wallet

* Remove explicit sync_send from commands, scripts

* Remove optional timeout parameter

This parameter doesn't seem to be used a lot and removing it makes the
remaining calls easier. Potentionally a contentious choice!

* Rename `broadcast` to `broadcast_transaction`

Doing so makes the method name consistent with the other ElectrumX protocol
method names.

* Remove synchronous_send

Now every method is intuitive in what it does, no special handling required.
The `broadcast_transaction` method is weird. I've opted not to change the
return type b/c I found it hard to know what the exact consequences are. But
ideally this method should just works as all the other ElectrumX related
messages. On the other hand this shows nicely how you _can_ do something
differnt quite easy.

* Rename the awkwardly name `__invoke` method

The new name reflects what it does.

* Process the result of linter feedback

I've used flake8-diff (and ignored a couple of line length warnings).

* Rename tx_response to on_tx_response

This fell through the cracks when this branch was rebased.

* subscript_to_scripthash should be get_balance

An oversight while refactoring.

* Add missing return statement

Without this statement the transaction would have been broadcasted twice.

* Pass list of tuples to send not single tuple

* Add @staticmethod decorator

* Fix argument to be an array
2018-06-06 15:06:04 +02:00
SomberNight
16e4827e8c
use libsecp256k1 if available. abstract away ecc stuff. move symmetric crypto and hash functions to crypto.py 2018-05-25 15:43:06 +02:00
ThomasV
4c234397ec
Merge pull request #4351 from SomberNight/2fa_sign_then_otp
trustedcoin: sign first, then prompt for OTP
2018-05-18 17:36:18 +02:00
SomberNight
5cfeb6b081
follow-up ab2f59590c 2018-05-18 10:56:01 +02:00
Harm Aarts
ab2f59590c Push network calls into network module
Eventually all network calls should go through the network module
without resorting to using raw protocol strings. This, then, makes
adding an other backend easier.
Please note that the behaviour slightly changed. Initially the caller
received an unmodified response from the ElectrumX server. In it the
scripthash is present. This change replaces that scripthash with the
original address.
2018-05-17 15:20:22 +02:00
SomberNight
ceae43afe5
trustedcoin: sign first, then prompt for OTP 2018-05-08 20:04:36 +02:00
Dimitris Apostolou
989c9c2b55 Fix typos 2018-04-15 20:34:40 +02:00
fivepiece
b4d71e651b add regtest support (#4242)
* add regtest support

* set default regtest ssl and tcp ports to 51002 and 51002

* regtest inherits parameters from testnet
2018-04-11 19:10:14 +02:00
SomberNight
1f937aa6cd
fix: 'oneserver' could only be set in the CLI 2018-04-11 11:16:29 +02:00
SomberNight
7b50790584
do not raise BaseException 2018-04-07 17:10:30 +02:00
ghost43
cf88e239d7
fix parsing values in setconfig (#4225) 2018-04-06 18:53:13 +02:00
SomberNight
d2a1179087
fix #4227 2018-04-05 12:22:01 +02:00
SomberNight
4d15d4e459
payto: get RBF setting from config 2018-04-02 05:30:58 +02:00
Laser Yuan
8a5d27dcf4
Fix the error: locktime is always reset to zero when serialize the json data
The "lockTime" field in the json object was ignored due to the wrong attribute name "locktime" was called.
2018-03-16 12:06:33 +08:00
ThomasV
5e5134b76f remove custom entropy option again (follow-up e0c38b3), because seeds can be extended with passphrase 2018-03-14 14:59:27 +01:00
ThomasV
0fbcb8229b
Merge pull request #3882 from SomberNight/storage_hw_encrypt_cli_support
cli support for hw encrypted wallets
2018-02-23 12:07:08 +01:00
ThomasV
826cf467d8 Improve wallet history tab:
- use json-serializable types
- add toolbar to history tab
- add button to display time interval
2018-02-19 12:42:27 +01:00
ThomasV
b2c0350240 allow to use exchange rates while offline 2018-02-14 10:42:59 +01:00
SomberNight
4cc2575d72 cli support for hw encrypted wallets 2018-02-10 20:07:06 +01:00
ThomasV
3f954a8b3d Factorize history export code used in GUI and command line.
Add options to export history limits and exchange rate.
Closes: #1752, #2604,
Replaces: #2715, 3724
2018-02-09 15:28:28 +01:00
SomberNight
ca19a36478 conflicting transactions 2018-02-06 05:39:40 +01:00
SomberNight
ffdc36285b use string.format instead of old style (%) formatting 2018-02-04 07:26:55 +01:00
ThomasV
c49335ed30
Merge pull request #3346 from SomberNight/encrypt_watch_only_wallets
allow encrypting watch-only wallets
2018-02-03 11:02:14 +01:00
ghost43
4737aa6c2a
migrated some commands from addr to scripthash (#3826)
* migrated some commands from addr to scripthash

* remove getproof command
2018-02-02 23:26:25 +01:00
ThomasV
2343894e0f Merge branch 'local_tx' 2018-01-30 00:22:02 +01:00
ThomasV
0e7e7e3dc5 Merge branch 'local_tx' 2018-01-30 00:18:44 +01:00
Johann Bauer
8676e870f3 Raise exception if transaction is not related to wallet 2018-01-28 22:56:33 +01:00
SomberNight
c811c5c9d9 allow encrypting watch-only wallets. initial support for hw wallet storage encryption. 2018-01-28 02:09:44 +01:00
Serge Victor
98663d7e20 Intruduction of getfee command, fixes #3704 2018-01-19 16:01:22 +01:00
ThomasV
e6dd3e6ad8 allow to save unbroadcasted transactions in wallet 2018-01-18 11:56:21 +01:00
SomberNight
d808bf057e fix notify command and migrate to use scripthashes 2018-01-16 16:35:29 +01:00
SomberNight
1c10d5dce1 remove --nossl option (follow-up dc388d4c7c) 2018-01-16 12:36:39 +01:00
SomberNight
a58d01ed54 setconfig rpcpassword: don't try to evaluate or reencode 2018-01-14 12:26:00 +01:00
ThomasV
dc388d4c7c replace SSL checkbox in GUI with command line option 2017-12-18 14:15:10 +01:00
SomberNight
38e3143bd0 fix command: createmultisig 2017-12-06 18:30:02 +01:00
SomberNight
65c15c5a03 fix verifymessage command 2017-12-04 17:36:57 +01:00
ThomasV
2ea59aad14 fix #3345: do not require a wallet in order to sweep 2017-11-29 13:45:02 +01:00
SomberNight
66cce115ef more robust commands.getprivatekeys() and bitcoin.is_segwit_address() 2017-11-19 23:46:59 +01:00
Justin Turner Arthur
857eb4ac1d Remove unused imports. Explicitly import a few deep imports. 2017-11-13 02:28:00 -06:00
Justin Turner Arthur
9a0aa9b478 Remove Python 2 support imports. 2017-11-13 02:26:48 -06:00
Justin Turner Arthur
07629e12af Fixes to signing, notify commands and command exception handling. 2017-11-12 16:15:06 -06:00
Antoine Riard
213798cfce [fix clearrequests] error iteration dictionary changed size 2017-11-09 11:54:25 -05:00
Dan Haiduc
5e589133c9 Update commands: output str(Decimals), not floats
The commands `listunspent` and `history` were using float.
Patched to consistently return strings of Decimal objects.
2017-10-20 21:35:18 +03:00
Antoine Riard
9ebca74724 fix: check_seed command import path 2017-10-20 12:03:02 -04:00
SomberNight
f69f6a88e0 py3: signmessage cmd now again returns str 2017-10-17 20:15:33 +02:00
ThomasV
a2048feb24 add segwit option for cmdline create 2017-10-17 11:45:55 +02:00
ThomasV
dc553ff108 fix #2991: encrypt wallet files created with command line 2017-10-15 09:18:14 +02:00