Commit graph

178 commits

Author SHA1 Message Date
chromatic 7a0b3034c7 Remove more implicit fallthrough compiler warnings 2021-09-01 20:52:06 -07:00
chromatic c2a0bd2890 qt: translate more user-exposed strings 2021-08-14 01:56:07 +02:00
Patrick Lodder 9370db962b
qt: translate all user-exposed strings 2021-08-11 23:09:13 +02:00
Ross Nicoll 51aca8e38d
Merge pull request #1825 from alamshafil/master
[QT] Add a form dialog for adding peers
2021-06-08 19:11:30 +01:00
Shafil Alam e0d1683bff Add a form dialog for adding peers
Fixed tabIndex and width in debugwindow.ui

Added Qt UI files for each dialog

Added Qt UI files

Added separate thread for peer dialogs to run RPC commands

Fixed tabIndex

Remove unneeded includes

Fixed error

Replaced RPCExecutor with g_connman

Replaced RPCExecutor with g_connman

Added two input fields for peer address and port

Remove peerThread

Validate IP addresses

Remove Peer now uses selected IP address in peerWidget

Interpret RPC response

Remove redundant include

Use a regular expression to validate IPs

Disconnect node if it has been discovered

Use port based on current chain

Change peerAddress -> peerPort

Allowed DNS names to be entered

Update src/qt/peerdialog.cpp

Co-authored-by: Ross Nicoll <rnicoll@rnicoll.name>

Fix typo

Co-authored-by: Ross Nicoll <rnicoll@rnicoll.name>

Use LookupHost to check address

Co-authored-by: Ross Nicoll <rnicoll@rnicoll.name>

Fix syntax typo
2021-06-05 15:23:01 -04:00
Patrick Lodder 843281ce87
[qt] User-friendly interpretation of null responses in rpc console
Translates "null" (UniValueNull) to "Empty response".
2021-03-11 10:02:18 +01:00
Cory Fields 30fa231011
net: define NodeId as an int64_t
This should make occurances of NodeId wrapping essentially impossible for
real-world usage.

Github-Pull: #10176
Rebased-From: c851be4b25
2017-04-14 10:35:49 +02:00
Andrew Chow ddc2dd1612 Ensure an item exists on the rpcconsole stack before adding
Ensures that there is an item on the rpcconsole stack before adding something to the current stack so that a segmentation fault does not occur.

Github-Pull: #10060
Rebased-From: 4df76e270c
2017-03-27 23:08:24 +02:00
Suhas Daftuar 99464bc38e net: Consistently use GetTimeMicros() for inactivity checks
The use of mocktime in test logic means that comparisons between
GetTime() and GetTimeMicros()/1000000 are unreliable since the former
can use mocktime values while the latter always gets the system clock;
this changes the networking code's inactivity checks to consistently
use the system clock for inactivity comparisons.

Also remove some hacks from setmocktime() that are no longer needed,
now that we're using the system clock for nLastSend and nLastRecv.
2017-01-25 09:48:14 -05:00
Pavel Janík 7df5e382e5 Rename lambda argument name to prevent shadowing. 2017-01-09 19:31:19 +01:00
Wladimir J. van der Laan c0ddd32bf6
Merge #9450: Increment MIT licence copyright header year on files modified in 2016
27765b6 Increment MIT Licence copyright header year on files modified in 2016 (isle2983)
2017-01-04 12:09:05 +01:00
isle2983 27765b6403 Increment MIT Licence copyright header year on files modified in 2016
Edited via:

$ contrib/devtools/copyright_header.py update .
2016-12-31 11:01:21 -07:00
Luke Dashjr 8562792095 GUI/RPCConsole: Include importmulti in history sensitive-command filter 2016-12-29 11:47:58 +00:00
Luke Dashjr ff77faf480 Qt/RPCConsole: Use RPCParseCommandLine to perform command filtering 2016-12-29 11:47:58 +00:00
Luke Dashjr 629cd42364 Qt/RPCConsole: Teach RPCParseCommandLine how to filter out arguments to sensitive commands 2016-12-29 11:46:26 +00:00
Luke Dashjr e2d9213c32 Qt/RPCConsole: Make it possible to parse a command without executing it 2016-12-29 11:43:29 +00:00
Luke Dashjr 1755c04576 Qt/RPCConsole: Truncate filtered commands to just the command name, rather than skip it entirely in history 2016-12-29 11:43:29 +00:00
Luke Dashjr d80a00660f Qt/RPCConsole: Add signmessagewithprivkey to list of commands filtered from history 2016-12-29 11:43:29 +00:00
Luke Dashjr afde12f265 Qt/RPCConsole: Refactor command_may_contain_sensitive_data function out of RPCConsole::on_lineEdit_returnPressed 2016-12-29 11:43:29 +00:00
Luke Dashjr de8980df9d Bugfix: Do not add sensitive information to history for real
Original code was missing braces, and short-circuited before checking everything after importprivkey
2016-12-29 11:43:29 +00:00
Jonas Schnelli 9044908636 Qt/RPCConsole: Don't store commands with potentially sensitive information in the history
Filters importprivkey, signrawtransaction, walletpassphrase, walletpassphrasechange, and encryptwallet
2016-12-29 11:43:28 +00:00
Jonas Schnelli fc95daa97f Qt/RPCConsole: Save current command entry when browsing history
Shell-like, but doesn't store changed history commands until executing it.
2016-12-29 11:43:28 +00:00
Wladimir J. van der Laan db45ad8516
Merge #9329: [Qt] Console: allow empty arguments
390bd14 [Qt] Console: don't allow empty arguments when using the comma-syntax (Jonas Schnelli)
6a32c0f Qt/Test: Check handling of empty arguments in RPC debug console (Luke Dashjr)
89c8d2c [Qt] Console: allow empty arguments (Jonas Schnelli)
2016-12-19 09:08:20 +01:00
Jonas Schnelli 390bd14684
[Qt] Console: don't allow empty arguments when using the comma-syntax 2016-12-14 09:00:09 +01:00
Jonas Schnelli 89c8d2c12c
[Qt] Console: allow empty arguments 2016-12-13 09:17:35 +01:00
Jonas Schnelli ed6b377ae2
[Qt] Console: add security warning 2016-12-12 15:58:40 +01:00
Wladimir J. van der Laan 9851a8461d
Merge #9255: qt: layoutAboutToChange signal is called layoutAboutToBeChanged
f36349e qt: Remove on_toggleNetworkActiveButton_clicked from RPCConsole (Wladimir J. van der Laan)
297cc20 qt: layoutAboutToChange signal is called layoutAboutToBeChanged (Wladimir J. van der Laan)
2016-12-08 08:14:16 +01:00
Wladimir J. van der Laan 2044e37beb
Merge #9266: Bugfix: Qt/RPCConsole: Put column enum in the right places
df17fe0 Bugfix: Qt/RPCConsole: Put column enum in the right places (Luke Dashjr)
2016-12-08 08:13:15 +01:00
Wladimir J. van der Laan f36349e898 qt: Remove on_toggleNetworkActiveButton_clicked from RPCConsole
There is no network toggle button (anymore?) in the RPC console.
Removes another warning (#9250).
2016-12-07 05:55:16 +01:00
Luke Dashjr df17fe046f Bugfix: Qt/RPCConsole: Put column enum in the right places
QModelIndex::data argument is a role, not a column
2016-12-02 13:51:14 +00:00
Wladimir J. van der Laan 297cc20e70 qt: layoutAboutToChange signal is called layoutAboutToBeChanged
This was misnamed, resulting in a warning message and missing
functionality. I'm not sure what the change in behavior will be here,
this needs testing.

Also remove connection to non-existing slot "test".
This was used for testing if the signal arrived. It is no
longer necessary.

Fixes:

    2016-12-01 10:04:06 GUI: QObject::connect: No such signal PeerTableModel::layoutAboutToChange() in qt/rpcconsole.cpp:518
    2016-12-01 10:04:06 GUI: QObject::connect:  (receiver name: 'RPCConsole')
    2016-12-01 10:04:06 GUI: QObject::connect: No such slot RPCConsole::test() in qt/rpcconsole.cpp:781
    2016-12-01 10:04:06 GUI: QObject::connect:  (receiver name: 'RPCConsole')
2016-12-01 11:45:07 +01:00
Wladimir J. van der Laan 693384eedb qt: Prevent thread/memory leak on exiting RPCConsole
Make ownership of the QThread object clear, so that the RPCConsole
can wait for the executor thread to quit before shutdown is called. This
increases overall thread safety, and prevents some objects from leaking
on exit.
2016-11-23 12:33:36 +01:00
Wladimir J. van der Laan 47db075377 qt: Plug many memory leaks
None of these are very serious, and are leaks in objects that are
created at most one time.

In most cases this means properly using the QObject parent hierarchy,
except for BanTablePriv/PeerTablePriv which are not QObject,
so use a std::unique_ptr instead.
2016-11-23 12:33:35 +01:00
Jonas Schnelli ab914a6530
Merge #8996: Network activity toggle
19f46f1 Qt: New network_disabled icon (Luke Dashjr)
54cf997 RPC/Net: Use boolean consistently for networkactive, and remove from getinfo (Luke Dashjr)
b2b33d9 Overhaul network activity toggle (Jonas Schnelli)
32efa79 Qt: Add GUI feedback and control of network activity state. (Jon Lund Steffensen)
e38993b RPC: Add "togglenetwork" method to toggle network activity temporarily (Jon Lund Steffensen)
7c9a98a Allow network activity to be temporarily suspended. (Jon Lund Steffensen)
2016-11-11 11:16:40 +01:00
Andrew Chow 1077577546 Fix auto-deselection of peers 2016-11-08 15:11:25 -05:00
Andrew Chow addfdebe1a Multiple Selection for peer and ban tables
Allows multiple selection and action for the nodes in the peer and ban tables in the Debug Window.
2016-11-08 08:50:04 -05:00
Jon Lund Steffensen 32efa79e0e Qt: Add GUI feedback and control of network activity state.
Add getNetworkActive()/setNetworkActive() method to client model.
Send network active status through NotifyNetworkActiveChanged.
Indicate in tool tip of gui status bar network indicator whether network activity is disabled.
Indicate in debug window whether network activity is disabled and add button to allow user to toggle network activity state.
2016-10-24 10:23:58 +00:00
Jonas Schnelli 69d1c25768
[RPC] Give RPC commands more information about the RPC request 2016-10-19 14:42:08 +02:00
R E Broadley 1724a405c9 Display minimum ping in debug window. 2016-10-15 20:43:11 +07:00
Cory Fields cb78c60534 gui: fix ban from qt console
Rather than doing a circle and re-resolving the node's IP, just use the one
from nodestats directly.

This requires syncing the addr field from CNode.
2016-10-04 19:43:53 -04:00
Pavel Janík f839350420 Do not shadow in src/qt 2016-09-23 12:42:00 +02:00
Wladimir J. van der Laan 4335d5a41b
Merge #7783: [Qt] RPC-Console: support nested commands and simple value queries
1586044 [Qt] RPC-Console: support nested commands and simple value queries (Jonas Schnelli)
2016-09-20 14:15:35 +02:00
Cory Fields c0569c7fa1 net: Add most functions needed for vNodes to CConnman 2016-09-08 12:12:58 -04:00
Cory Fields a0f3d3cdad net: move ban and addrman functions into CConnman 2016-09-08 12:12:57 -04:00
Cory Fields 531214fb10 gui: add NodeID to the peer table 2016-09-08 12:03:22 -04:00
Jonas Schnelli 15860448d3
[Qt] RPC-Console: support nested commands and simple value queries
Commands can be executed with bracket syntax, example: `getwalletinfo()`.
Commands can be nested, example: `sendtoaddress(getnewaddress(), 10)`.
Simple queries are possible: `listunspent()[0][txid]`
Object values are accessed with a non-quoted string, example: [txid].

Fully backward compatible.
`generate 101` is identical to `generate(101)`
Result value queries indicated with `[]` require the new brackets syntax.
Comma as argument separator is now also possible: `sendtoaddress,<address>,<amount>`
Space as argument separator works also with the bracket syntax, example: `sendtoaddress(getnewaddress() 10)

No dept limitation, complex commands are possible:
`decoderawtransaction(getrawtransaction(getblock(getbestblockhash())[tx][0]))[vout][0][value]`
2016-08-23 15:32:39 +02:00
Cory Fields 21ba407a73 net: narrow include scope after moving to netaddress
Net functionality is no longer needed for CAddress/CAddrman/etc. now that
CNetAddr/CService/CSubNet are dumb storage classes.
2016-07-31 14:01:44 -04:00
Cory Fields b6c3ff3dae net: Split resolving out of CSubNet 2016-07-31 14:01:43 -04:00
Cory Fields 31d6b1d5f0 net: Split resolving out of CNetAddr 2016-07-31 13:24:07 -04:00
Wladimir J. van der Laan a7897c02f7 qt: Remove client name from debug window
Remove the client name from the debug window in the GUI. It is already
part of the user agent, so adding it separately doesn't add anything.
2016-06-28 18:27:49 +02:00