Commit graph

150 commits

Author SHA1 Message Date
Matt Corallo 4e97a9d9eb Lock vnThreadsRunning[THREAD_RPCHANDLER]. 2012-06-28 18:34:11 +02:00
Matt Corallo 7cf3d2ccb9 Use a rpc-specific queue to tell asio connections to shutdown. 2012-06-28 18:32:32 +02:00
Matt Corallo 18c4beb05b Revert "*Always* send a shutdown signal to enable custom shutdown actions"
This reverts commit 896899e0d6.
2012-06-28 15:52:45 +02:00
Giel van Schijndel ad25804feb Cancel outstanding listen ops for RPC when shutting down
Use Boost's signal2 slot tracking mechanism to cancel any (still open)
listening sockets when receiving a shutdown signal.

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-06-24 15:12:15 +02:00
Giel van Schijndel 415a87ef36 Merge branch 'master' into async-ipv6-rpc 2012-06-24 12:34:15 +02:00
Jeff Garzik 25d5c19522 RPC: add 'getrawmempool', listing all transaction ids in memory pool 2012-06-22 11:43:34 -04:00
Giel van Schijndel 896899e0d6 *Always* send a shutdown signal to enable custom shutdown actions
NOTE: This is required to be sure that we can properly shut down the RPC
      thread.

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-06-17 21:50:49 +02:00
Giel van Schijndel 07368a9e3c Merge branch 'master' into async-ipv6-rpc
Conflicts:
	src/bitcoinrpc.cpp

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-06-17 14:30:37 +02:00
Philip Kaufmann 9247134eab introduce a new StartShutdown() function, which starts a thread with Shutdown() if no GUI is used and calls uiInterface.QueueShutdown() if a GUI is used / all direct uiInterface.QueueShutdown() calls are replaced with Shutdown() - this ensures a clean GUI shutdown, even when catching a SIGTERM and allows the BitcoinGUI destructor to get called (which fixes a tray-icon issue and keeps the tray-icon until Bitcoin-Qt exits) 2012-06-12 07:21:03 +02:00
Gavin Andresen 46e06b875d Merge branch 'netopt' of https://github.com/sipa/bitcoin 2012-06-04 14:15:19 -04:00
Gavin Andresen 98474d3d6f Use ConvertTo to simplify sendmany/addmultisigaddress argument handling 2012-05-31 16:09:31 -04:00
Gavin Andresen ea7582bb41 Make sendrawtx return txid to be consistent with other send methods. 2012-05-31 16:05:07 -04:00
Pieter Wuille 587f929c64 Rework network config settings 2012-05-31 18:12:35 +02:00
Giel van Schijndel fbf9df2ea3 Use the QueueShutdown signal to stop accepting new RPC connections
Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-05-25 07:27:25 +02:00
Giel van Schijndel 7cc2ceae09 Allow all addresses on the loopback subnet (127.0.0.0/8) not just 127.0.0.1
Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-05-25 07:27:24 +02:00
Giel van Schijndel a0780ba08a Generalise RPC connection handling code to allow more listening sockets
Using this modification it should be relatively easy to, at a later
time, listen on multiple addresses (even Unix domain sockets should be
possible).

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-05-25 07:27:24 +02:00
Giel van Schijndel 43b6dafa6e Allow clients on the IPv6 loopback as well
Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-05-25 07:27:24 +02:00
Giel van Schijndel c1ecab818c Add dual IPv4/IPv6 stack support to the RPC server
The RPC server now listens for, and handles, incoming connections on
both IPv4 as well as IPv6.

If available (and usable) it uses a dual IPv4/IPv6 socket on systems
that support it (e.g. Linux and BSDs) and falls back to separate
IPv4/IPv6 sockets on systems that don't (e.g. Windows).

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-05-25 07:27:24 +02:00
Giel van Schijndel 914dc01222 Use asynchronous I/O to handle RPC requests
This allows more flexibility in the RPC code, e.g. making it easier to
handle multiple simultaneous connections later on.

Currently asynchronous I/O is only used to listen for and accept
incoming connections.  Asynchronous reading/writing is more involved.

Signed-off-by: Giel van Schijndel <me@mortis.eu>
2012-05-25 07:27:24 +02:00
Pieter Wuille 1025440184 Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
This introduces internal types:
* CKeyID: reference (hash160) of a key
* CScriptID: reference (hash160) of a script
* CTxDestination: a boost::variant of the former two

CBitcoinAddress is retrofitted to be a Base58 encoding of a
CTxDestination. This allows all internal code to only use the
internal types, and only have RPC and GUI depend on the base58 code.

Furthermore, the header dependencies are a lot saner now. base58.h is
at the top (right below rpc and gui) instead of at the bottom. For the
rest: wallet -> script -> keystore -> key. Only keystore still requires
a forward declaration of CScript. Solving that would require splitting
script into two layers.
2012-05-24 20:26:19 +02:00
Pieter Wuille fd61d6f506 Encapsulate public keys in CPubKey 2012-05-24 19:58:12 +02:00
Jeff Garzik 976c08b68a JSON-RPC: Add 'sendrawtx' op, for sending pre-built TX's to network 2012-05-23 16:21:25 -04:00
Pieter Wuille 46784d0826 Merge pull request #1354 from fanquake/master
Update Header Licenses
2012-05-20 12:27:50 -07:00
Wladimir J. van der Laan 239c11d0dd Make testcases build, prevent windows symbol collision 2012-05-20 10:44:50 +02:00
Wladimir J. van der Laan ab1b288fa7 Convert UI interface to boost::signals2.
- Signals now go directly from the core to WalletModel/ClientModel.
  - WalletModel subscribes to signals on CWallet: Prepares for multi-wallet support, by no longer assuming an implicit global wallet.
- Gets rid of noui.cpp, the few lines that were left are merged into init.cpp
- Rename wxXXX message flags to MF_XXX, to make them UI indifferent.
- ThreadSafeMessageBox no longer returns the value `4` which was never used, converted to void.
2012-05-20 10:44:50 +02:00
Pieter Wuille bd795bd543 Merge pull request #1358 from luke-jr/shared_lockchk
Shared code for wallet lock help and check
2012-05-19 08:34:27 -07:00
Luke Dashjr 29875dcb4b Shared code for wallet lock help and check 2012-05-18 23:13:21 +00:00
Philip Kaufmann ff0ee876bb change strings to Bitcoin (uppercase), where it is used as a noun and update strings to use "Qt" (and not qt or QT) / update initialisation of notificator to use qApp->applicationName() instead of a static string 2012-05-18 23:13:58 +02:00
Fordy 3a25a2b9b0 Update License in File Headers
I originally created a pull to replace the "COPYING" in crypter.cpp and
crypter.h, but it turned out that COPYING was actually the correct
file.
2012-05-18 22:02:28 +08:00
Jeff Garzik 47f48a658d JSON-RPC: remove 'getblocknumber' deprecated RPC
RPC 'getblockcount' should be used instead.
2012-05-17 23:43:00 -04:00
Jeff Garzik 7563424f32 Merge pull request #1334 from rebroad/Exiting2Exited
Corrected grammar. As per Principle Of Least Surprise.
2012-05-17 11:29:09 -07:00
R E Broadley 1d764d631f Corrected grammar. As per Principle Of Least Surprise. 2012-05-17 18:52:38 +01:00
Jeff Garzik 0fb78eae34 Always check return values of TxnBegin() and TxnCommit() 2012-05-14 01:11:11 -04:00
Pieter Wuille 22db3f2c77 Fix warning about uninitialized value
Only reported when using -flto.
2012-05-13 01:36:46 +02:00
Philip Kaufmann bc05562730 convert 4 tabs into 4 x 4 spaces in bitcoinrpc.cpp 2012-05-12 11:06:30 +02:00
Jeff Garzik b34c5f3c0f Merge pull request #1101 from jgarzik/http11
Multithreaded JSON-RPC with HTTP 1.1 Keep-Alive support
2012-05-11 09:57:08 -07:00
Gregory Maxwell d285c7bf2c Kill warning from unavoidable signed/unsigned comparison in bitcoinrpc.cpp. 2012-05-09 07:17:30 -04:00
David Joel Schwartz 96c5269511 RPC: Support HTTP/1.0 and HTTP/1.1, including the proper use of keep-alives 2012-05-08 20:25:39 -04:00
David Joel Schwartz e9205293bd Support multi-threaded JSON-RPC
Change internal HTTP JSON-RPC server from single-threaded to
thread-per-connection model.  The IP filter list is applied prior to starting
the thread, which then processes the RPC.

A mutex covers the entire RPC operation, because not all RPC operations are
thread-safe.

[minor modifications by jgarzik, to make change upstream-ready]
2012-05-08 20:11:17 -04:00
Luke Dashjr 7e63dc3615 Support for decomposing scripts as "obj" 2012-05-08 21:04:57 +00:00
Luke Dashjr 74335bd32a Second parameter to JSON-RPC getblock/gettransaction: decompositions
This is an Object specifying how to decompose specific elements.
Currently supported:
- "tx": "no", "hash", "hex", "obj"
- "script": "no", "hex", "asm"
2012-05-08 21:04:52 +00:00
Luke Dashjr d4e09300f3 Add block "confirmations" to getblock, mainly for identifying orphans 2012-05-08 21:04:47 +00:00
Gregory Maxwell 2f1dca645b Merge pull request #841 from sipa/getalltransactions
gettransaction RPC for non-wallet transactions
2012-05-08 13:19:11 -07:00
Gregory Maxwell fa8cc47c4f Merge pull request #1075 from laanwj/2012_04_consoleui
Add UI RPC console / debug window
2012-05-08 12:26:49 -07:00
Wladimir J. van der Laan 460c51fdad Add UI RPC console / debug window 2012-05-05 10:37:06 +02:00
Peter Todd 86c47a5636 Fixed non-sensical error message
Previously trying to create a multisig address that required less than
one signature would output something like the following:

"wrong number of keys(got 1, need at least 0)"
2012-05-04 00:41:00 -04:00
Gavin Andresen dfead66eac Merge pull request #1151 from freewil/listsinceblock-blockhash
listsinceblock: rpc param blockid -> blockhash
2012-04-26 15:37:12 -07:00
freewil 42ce57687a remove strange debug message from listsinceblock 2012-04-26 13:12:44 -04:00
freewil fdb204abb1 listsinceblock: rpc param blockid -> blockhash
This is more consistent with the rest of the labeling seen
by the user when accessing the rpc commands.
2012-04-26 12:48:33 -04:00
Jeff Garzik 1d8c7a9557 Add casts for unavoidable signed/unsigned comparisons
At these code sites, it is preferable to cast rather than change
a variable's type.
2012-04-23 14:14:36 -04:00