Commit graph

37 commits

Author SHA1 Message Date
practicalswift cc16d99f1d [trivial] Fix typos in comments 2017-01-27 21:22:35 +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
Wladimir J. van der Laan ed998ea7a0 qt: Avoid OpenSSL certstore-related memory leak
- Correctly manage the X509 and X509_STORE objects lifetime.
2016-11-23 12:33:37 +01:00
MarcoFalke fa24439ff3 Bump copyright headers to 2015 2015-12-13 18:08:39 +01:00
Philip Kaufmann be942def4b [Qt] add verifySize() function to PaymentServer
- add static verifySize() function to PaymentServer and move the logging
  on error into the function
- also use the new function in the unit test
- the function checks if the size is allowed as per BIP70
2015-08-10 14:12:15 +02:00
Wladimir J. van der Laan d29ec6c230 qt: define QT_NO_KEYWORDS
QT_NO_KEYWORDS prevents Qt from defining the `foreach`, `signals`,
`slots` and `emit` macros.

Avoid overlap between Qt macros and boost - for example #undef hackiness
in #6421.
2015-07-15 07:30:23 +02:00
Philip Kaufmann 35d15959b0 [Qt] constify first parameter of processPaymentRequest() 2015-04-15 14:31:50 +02:00
Philip Kaufmann a6516686dc [Qt] prevent amount overflow problem with payment requests
Bitcoin amounts are stored as uint64 in the protobuf messages (see
paymentrequest.proto), but CAmount is defined as int64_t. Because
of that we need to verify that single and accumulated amounts are
in a valid range and no variable overflow has happened.

- fixes #5624 (#5622)

Thanks @SergioDemianLerner for reporting that issue and also supplying us
with a possible solution.

- add static verifyAmount() function to PaymentServer and move the logging
  on error into the function
- also add a unit test to paymentservertests.cpp
2015-02-04 13:47:32 +01:00
Philip Kaufmann 6715efb9ca [Qt] Payment request expiration bug fix (re-done)
- this is based on #4122 (which can be closed)

Currently a payment request is only checked for expiration upon receipt.
It should be checked again immediately before sending coins to prevent
the user from paying to an expired invoice which would then require a
customer service interaction.

- add static verifyExpired() function to PaymentServer to be able to use
  the same validation code in GUI and unit-testing code
- extend unit tests to use that function and also add an unit test which
  overflows, because payment requests allow expires as uint64, whereas we
  use int64_t for verification of expired payment requests
2015-01-15 09:08:22 +01:00
Philip Kaufmann 17005bc0fc [Qt] add payment request unit test for non matching networks
- verify that payment request network matches client network
- add static verifyNetwork() function to PaymentServer to be able to use
  the same validation code in GUI and unit-testing code
2015-01-14 13:15:26 +01:00
sandakersmann f914f1a746
Added "Core" to copyright headers
Github-Pull: #5494
Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
2014-12-19 19:55:32 +01:00
Philip Kaufmann 5ec654b8ce [Qt] update paymentserver license and cleanup ordering 2014-12-08 16:09:02 +01:00
Philip Kaufmann 4333e26c8e [Qt] add BIP70 DoS protection test
- this test required to make readPaymentRequestFromFile() public in order
  to be able to is it in paymentservertests.cpp
2014-12-08 16:09:01 +01:00
Philip Kaufmann 31f84944a5 [Qt] add BIP70 payment request size DoS protection for URIs
- current code only does this for payment request files, which are
  used on Mac
- also rename readPaymentRequest to readPaymentRequestFromFile, so it's
  obvious that function only handles payment request files and not URIs
- small logging changes in readPaymentRequestFromFile
2014-12-08 16:08:59 +01:00
Philip Kaufmann b82695b89f [Qt] make PaymentServer::ipcParseCommandLine void
- the function only returned true, so make it void
- add a comment about payment request network detection
2014-12-08 16:08:57 +01:00
Pavel Janík 84738627ce Fix all header defines 2014-11-03 16:16:40 +01:00
Philip Kaufmann f5ae6c9826 add NetworkIDString() to chainparams
- returns the BIP70 network string
- use that new function in the core and GUI code and remove unused code
  and functions
2014-06-12 13:19:12 +02:00
jtimon f0a83fc256 Use Params().NetworkID() instead of TestNet() from the payment protocol 2014-06-04 15:33:11 +02:00
gubatron 57702541a2 Copyright header updates s/2013/2014 on files whose last git commit was done in 2014.
contrib/devtools/fix-copyright-headers.py script to be able to perform this maintenance task with ease during the rest of the year, every year. Modifications to contrib/devtools/README.md to document what fix-copyright-headers.py does.
2014-02-09 21:06:06 -05:00
Wladimir J. van der Laan f126973fd0
Merge pull request #3374
bd70562 [Qt] add messages when handling local payment request files (Philip Kaufmann)
2014-01-13 17:11:05 +01:00
Wladimir J. van der Laan 2102ab9f5c ui: Fix GUI initialization order
Fixes at least #3478.

Splits and documents the phases:
1. Parse command-line options. These take precedence over anything else.
2. Basic Qt initialization (not dependent on parameters or configuration)
3. Application identification
4. Initialization of translations
5. Now that settings and translations are available, ask user for data directory
6. Determine availability of data directory and parse bitcoin.conf
7. URI IPC sending
8. Main GUI initialization

Splits command line parsing logic from ipcSendCommandLine into
ipcParseCommandLine, as isTestNet() can only be overridden in the early
stages before choosing a data directory. Sending however needs to happen
after choosing a data directory.
2014-01-05 12:55:03 +01:00
Philip Kaufmann bd70562f66 [Qt] add messages when handling local payment request files
- important for the open URI dialog to give users feedback
  when a file is invalid etc.
2013-12-10 11:04:37 +01:00
Philip Kaufmann 4cf3411056 [Qt] misc PaymentServer changes (e.g. changes to eventFilter())
- make eventFilter() private and pass events on to QObject::eventFilter()
  instead of just returning false
- re-work paymentservertest.cpp to correctly handle the event test
  after the above change (rewrite test_main to allow usage of
  QCoreApplication:: in the tests)
- delete socket when we were unable to connect in ipcSendCommandLine()
- show a message to the user if we fail to start-up (instead of just a
  debug.log entry)
- misc small comment changes
2013-12-06 11:06:57 +01:00
Wladimir J. van der Laan a6aa179699 Merge pull request #3187 from Diapolo/netManager
[Qt] paymentserver: start netManager in uiReady()
2013-11-11 07:00:34 -08:00
Wladimir J. van der Laan 4c60358604 qt: add Open URI dialog 2013-11-11 14:29:49 +01:00
Philip Kaufmann 7634e0d8de [Qt] paymentserver: start netManager in uiReady()
- remove explicit init of netManager as this is done in the constructor
  anyway
- move initNetManager() call to uiReady(), which removes an assert() and
  allows us to use message() in initNetManager() (currently unused but
  could be necessary because of proxy related messages)
- make initNetManager() private
- update paymentservertests.cpp
2013-11-11 14:20:00 +01:00
Brandon Dahler 51ed9ec971 Cleanup code using forward declarations.
Use misc methods of avoiding unnecesary header includes.
Replace int typedefs with int##_t from stdint.h.
Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h.
Normalize QT_VERSION ifs where possible.
Resolve some indirect dependencies as direct ones.
Remove extern declarations from .cpp files.
2013-11-10 09:36:28 -06:00
Wladimir J. van der Laan 65d0fc4b73
Merge pull request #3145
395d0d5 rework an ugly hack in processPaymentRequest() (Philip Kaufmann)
952d2cd make processPaymentRequest() use a single SendCoinsRecipient (Philip Kaufmann)
983cef4 payment-request UI: use SendCoinsRecipient.message for memo (Philip Kaufmann)
c6c97e0 [Qt] Rework of payment request UI (mainly for insecure pr) (Philip Kaufmann)
2013-11-06 16:43:18 +01:00
Wladimir J. van der Laan e592d43f51 qt: add license header to source files
Closes #839
2013-11-04 16:27:09 +01:00
Philip Kaufmann 952d2cdb56 make processPaymentRequest() use a single SendCoinsRecipient
- as one this pulls main purpose is to change a payment request to
  be displayed as a single sendcoins entry
2013-10-31 17:51:39 +01:00
Philip Kaufmann 08dd1b7be1 Qt: move paymentACK handling to paymentserver
- add new slot handlePaymentACK() to paymentserver, which handles
  paymentACK messages (currently we just display them)
- make paymentACK message a modal information dialog
- change some QObject::tr() to just tr()
- clarify the processPaymentRequest() error, when IsDust()
- small string change to prevent a tripple + usage with QString
2013-10-24 15:43:55 +02:00
Philip Kaufmann 95d4a2be95 paymentserver: style fixes / cleanup
- rename reportError() into message() to be in line with our default
  message() signal/slot naming (and can be used for all types of messages)
- rename some QStrings to not collide with message() function
- add a missing message for malformed URIs that IS also used in BitcoinGUI
- fix / extend some comments and misc style fixes
2013-10-19 16:27:04 +02:00
Philip Kaufmann d78900cc1b fix some cosmetic glitches in the codebase
- rename URL into URI in paymentserver where correct
- add some missing Qt-coding-stuff in paymentserver
- change QSpinBox to QLineEdit as base for BitcoinAmountField in .ui files
  (as this is the result when converting the BAF back into base)
- remove some c_str() and replace with QString::fromStdString()
- remove several new-lines
- remove unneeded spaces
- indentation fixes
2013-09-09 12:36:04 +02:00
Philip Kaufmann bdd0c59ab0 Bitcoin-Qt: fixes for using display unit from options
- extend PaymentServer with setOptionsModel() and rework initNetManager()
  to make use of that
- fix all other places in the code to use display unit from options and no
  hard-coded unit
2013-08-29 10:38:51 +02:00
Gavin Andresen a41d5fe019 Payment Protocol: X509-validated payment requests
Add support for a Payment Protocol to Bitcoin-Qt.

Payment messages are protocol-buffer encoded and communicated over
http(s), so this adds a dependency on the Google protocol buffer
library, and requires Qt with OpenSSL support.
2013-08-22 16:18:25 +10:00
Philip Kaufmann b001c87126 small indentation, space, formatting fixes (no code changes) 2013-04-06 02:29:33 +02:00
Gavin Andresen 8269a0953e Reimplement click-to-pay links. Add OSX support.
Switch to using Qt's QLocalServer/QLocalSocket to handle bitcoin
payment links (bitcoin:... URIs)

Reason for switch: the boost::interprocess mechanism seemed flaky,
and doesn't mesh as well with "The Qt Way"

qtipcserver.cpp/h is replaced by paymentserver.cpp/h

Click-to-pay now also works on OSX, with a custom Info.plist
that registers Bitcoin-Qt as a handler for bitcoin: URLs and
an event listener on the main QApplication that handles
QFileOpenEvents (Qt translates 'url clicked' AppleEvents into
QFileOpenEvents automagically).
2013-02-12 15:41:31 -05:00