Commit graph

3583 commits

Author SHA1 Message Date
Matt Corallo 21aaf255ff Use CPartialMerkleTree for CMerkleBlock transactions. 2013-01-16 14:34:06 -05:00
Pieter Wuille 4bedfa9223 Add CPartialMerkleTree
This adds a compact representation for a subset of a merkle tree's
nodes.
2013-01-16 14:34:06 -05:00
Matt Corallo b1f99bed6f Add a nTweak to bloom filters to tweak the seed. 2013-01-16 12:48:02 -05:00
Matt Corallo 4c8fc1a588 Let a node opt out of tx invs before we get a their bloom filter
Note that the default value for fRelayTxes is false, meaning we
now no longer relay tx inv messages before receiving the remote
peer's version message.
2013-01-16 12:48:02 -05:00
Matt Corallo b02ddbedcb Relay CMerkleBlocks when asked for MSG_FILTERED_BLOCK 2013-01-16 12:48:02 -05:00
Matt Corallo 2878c67cb5 Add test cases for CMerkleBlock and CBloomFilter. 2013-01-16 12:48:02 -05:00
Matt Corallo 9fb106e757 Add a CMerkleBlock to store merkle branches of filtered txes. 2013-01-16 12:48:02 -05:00
Matt Corallo 587f0f855e Add a CBlock.GetBlockHeader 2013-01-16 12:48:02 -05:00
Matt Corallo d3b26f7077 Automatically add any matching outputs to a filter during matching. 2013-01-16 12:48:02 -05:00
Matt Corallo 269d9c6492 Replace RelayMessage with RelayTransaction. 2013-01-16 12:48:02 -05:00
Matt Corallo 422d122537 Add a filter field in CNode, add filterload+filteradd+filterclear 2013-01-16 12:48:02 -05:00
Matt Corallo 133a546074 Bump PROTOCOL_VERSION for filter messages. 2013-01-16 12:48:02 -05:00
Matt Corallo bd21612c37 Add a CBloomFilter class for use as a transaction filter. 2013-01-16 12:48:01 -05:00
Matt Corallo 7ab026f449 Add MurmurHash3 implementation to hash.h/add hash.cpp. 2013-01-16 12:48:01 -05:00
Matt Corallo 68feac96b6 Add const versions of base_uint.end()/begin(), make size() const. 2013-01-16 12:48:01 -05:00
Gavin Andresen 5f04881618 Fix clang warnings 2013-01-15 17:27:29 -05:00
Gavin Andresen ce99358f4a Remove IsFromMe() check in CTxMemPool::accept()
Fixes issue #2178 : attacker could penny-flood with invalid-signature
transactions to deduce which addresses belonged to your node.

I'm committing this early for code review; I still need to write up
a test plan.

Executive summary of fix: check all transactions received from the network
for penny-flood rate-limiting before adding to the memory pool. But do NOT
ratelimit transactions added to the memory pool:
  - because of blockchain reorgs
  - stored in the wallet and added at startup
  - sent from the GUI or one of the send* RPC commands (CWallet::CommitTransaction)

The limit-free-transactions code really should be a method on CNode, with
counters per-peer. But that is a bigger change for another day.
2013-01-15 09:10:22 -05:00
Philip Kaufmann 3a2e07493b update bitcoinstrings.cpp and bitcoin_en.ts (2013-01-14) 2013-01-14 22:52:52 +01:00
Gavin Andresen c83c3cbe97 Merge pull request #2172 from Diapolo/init_messages
make database init messages more valuable
2013-01-14 12:49:42 -08:00
Gavin Andresen e4f2b6b08f Merge pull request #2159 from petertodd/display-nlocktime-correctly
Display tx nLockTime correctly when set to block #
2013-01-14 12:06:07 -08:00
Gavin Andresen 9980d118ee Merge pull request #2129 from gmaxwell/wallet_less_frequent_fees
If the prio. will be enough after the next block don't force fees. [wallet]
2013-01-14 12:05:06 -08:00
Gavin Andresen 1eca3a0f0d Merge branch 'macdeployqt_fix' of git://github.com/themighty1/bitcoin 2013-01-14 14:58:08 -05:00
Gavin Andresen 1b72229797 Merge pull request #2161 from sipa/noclient
Remove fClient
2013-01-14 11:41:19 -08:00
Gavin Andresen dd46c88f2f Merge pull request #2099 from gavinandresen/blkfile_upgrade
Upgrading to 0.8: re-use blkNNNN.dat files.
2013-01-14 11:37:12 -08:00
Gavin Andresen 40e31fd373 Merge pull request #2142 from gavinandresen/utilprint
OutputDebugStringF code cleanup
2013-01-14 11:36:48 -08:00
Gavin Andresen 7a08ee7c6d Merge branch 'devprocess' 2013-01-14 14:32:01 -05:00
Gavin Andresen b67b9e7077 Update development process README to reflect current reality 2013-01-14 14:31:10 -05:00
Philip Kaufmann 06494cabb4 make database init messages more valuable
- it was bad, that quite some messages were just talking about a database,
  I think a user should know, if we are talking about wallet db or
  block/coin db
- also adds a new init message for "Verifying block database integrity..."
2013-01-13 21:22:40 +01:00
Wladimir J. van der Laan 6213b25cd4 Merge pull request #2166 from Diapolo/Qt_signverify
Bitcoin-Qt: use reference in setAddress_SM() and setAddress_VM()
2013-01-13 10:53:42 -08:00
Philip Kaufmann bb41a87d57 add InitMessage() to noui and use debug.log for GUI
- this pull adds an InitMessage() function to noui.cpp, which outputs init
  messages to debug.log (this allows to remove some printf() calls from
  init.cpp)
- change InitMessage() in bitcoin.cpp to also write init messages to
  debug.log to ensure nothting is missing in the log because of the
  removal of printf() calls in init.cpp
2013-01-11 22:57:22 +01:00
Jeff Garzik e0c8fbac35 Merge pull request #2169 from Diapolo/small_main_h_cleanup
small main.h cleanup (no code changes)
2013-01-11 09:17:14 -08:00
Philip Kaufmann ec95a809af small main.h cleanup (no code changes)
- removes some obsolete comments about CTransaction::FetchInputs(), a
  space and a few new-lines
2013-01-11 17:36:53 +01:00
Gregory Maxwell 1f4b80a437 Merge pull request #2145 from sipa/checkcoins
Coin database checks
2013-01-11 06:27:30 -08:00
Pieter Wuille 45a1ec51b1 Merge pull request #2115 from forrestv/getblocktemplate_allfees
Provide fee data for all txs in RPC getblocktemplate response
2013-01-10 13:09:51 -08:00
Philip Kaufmann 17c1f7f04f Bitcoin-Qt: use reference in setAddress_SM() and setAddress_VM() 2013-01-10 14:04:32 +01:00
Pieter Wuille c2b72ba27f Remove fClient
Client (SPV) mode never got implemented entirely, and whatever part was already
working, is likely not been tested (or even executed at all) for the past two
years. This removes it entirely.

If we want an SPV implementation, I think we should first get the block chain
data structures to be encapsulated in a class implementing a standard interface,
and then writing an alternate implementation with SPV semantics.
2013-01-09 22:28:46 +01:00
Philip Kaufmann e6d2300562 Bitcoin-Qt: fix known addressbook bugs
- add qSort() for cachedAddressTable, as qLowerBound() and qUpperBound()
  require the list to be in ascending order (see
  http://harmattan-dev.nokia.com/docs/library/html/qt4/qtalgorithms.html#qLowerBound)
- add a new check in AddressTableModel::setData() to just return, when no
  changes were made to a label or an address (prevents entry duplication
  issue)
- remove "rec->label = value.toString();" from
  AddressTableModel::setData() as the label gets updated by
  AddressTablePriv::updateEntry() anyway (seems @sipa added this line via
  1025440184 (L6R225))
- add another new check in AddressTableModel::setData() to just return, if
  a duplicate address was found (prevents address overwrite)
- add a new check to EditAddressDialog::setModel() to prevent setting an
  invalid model
- re-work the switch-case statement in AddressTableModel::accept() to
  always break (as return get's called anyway) and order the list to match
  the enum definition
- make accept() in editaddressdialog.h a public slot, which it should be
- misc small coding style changes
2013-01-09 16:55:24 +01:00
Peter Todd 10046e27db Display tx nLockTime correctly when set to block #
Previously when a transaction was set to lock at a specific block the
calculation was reversed, returning a negative number. This broke the UI
and caused it to display %n in place of the actual number.

In addition the previous calculation would display "Open for 0 blocks"
when the block height was such that the next block created would
finalize the transaction. Inserted the word "more" and changed the
calculation so that the last message would be "Open for 1 more block" to
better match user expectations.
2013-01-09 04:18:26 -05:00
Pieter Wuille ef0f422519 Remove contention on signature cache during block validation
Since block validation happens in parallel, multiple threads may be
accessing the signature cache simultaneously. To prevent contention:
* Turn the signature cache lock into a shared mutex
* Make reading from the cache only acquire a shared lock
* Let block validations not store their results in the cache
2013-01-08 02:00:59 +01:00
Pieter Wuille f9cae832e6 Parallelize script verification
* During block verification (when parallelism is requested), script
  check actions are stored instead of being executed immediately.
* After every processed transactions, its signature actions are
  pushed to a CScriptCheckQueue, which maintains a queue and some
  synchronization mechanism.
* Two or more threads (if enabled) start processing elements from
  this queue,
* When the block connection code is finished processing transactions,
  it joins the worker pool until the queue is empty.

As cs_main is held the entire time, and all verification must be
finished before the block continues processing, this does not reach
the best possible performance. It is a less drastic change than
some more advanced mechanisms (like doing verification out-of-band
entirely, and rolling back blocks when a failure is detected).

The -par=N flag controls the number of threads (1-16). 0 means auto,
and is the default.
2013-01-08 02:00:59 +01:00
Pieter Wuille 1d70f4bde8 Remove CheckSig_mode and move logic out of CheckInputs() 2013-01-08 01:49:15 +01:00
Pieter Wuille 2800ce7367 Add CScriptCheck: a closure representing a script check 2013-01-08 01:49:15 +01:00
Pieter Wuille f1136200a6 Move VerifySignature to main 2013-01-08 01:49:14 +01:00
Wladimir J. van der Laan 429915bd0d Merge pull request #2153 from Diapolo/overviewpage
Bitcoin-Qt: fix small stylesheet glitch in overviewpage.ui
2013-01-06 07:26:43 -08:00
Wladimir J. van der Laan 12aacd582a Merge pull request #2151 from Diapolo/signmessage
Bitcoin-Qt: add a Signature label on sign message page
2013-01-06 05:23:01 -08:00
Wladimir J. van der Laan 51b05d0dca Merge pull request #2147 from Diapolo/mq_name_testnet
Bitcoin-Qt: give testnet a unique IPC message queue name
2013-01-06 05:22:34 -08:00
Wladimir J. van der Laan 13013f5044 Merge pull request #2143 from Diapolo/ThreadSafeMessageBox_caption
update ThreadSafeMessageBox function to use strCaption
2013-01-06 05:21:10 -08:00
Philip Kaufmann 765e22b82c Bitcoin-Qt: fix small stylesheet glitch in overviewpage.ui 2013-01-06 12:41:49 +01:00
Philip Kaufmann aec056edb5 Bitcoin-Qt: add a Signature label on sign message page 2013-01-06 03:52:33 +01:00
Philip Kaufmann 37f070f564 update noui_ThreadSafeMessageBox function to use strCaption
- ensure we use strCaption for printf and fprintf, as before it could
  happen to have an error message in the debug.log, which had no "Error"
  (or whatever) in front
2013-01-06 03:47:10 +01:00