Commit graph

4067 commits

Author SHA1 Message Date
Wladimir J. van der Laan b29b509612
Merge pull request #4325
4aaa017 rework help messages for fee-related options (Philip Kaufmann)
2014-07-01 12:55:33 +02:00
Wladimir J. van der Laan dd638dd712
typedef std::map<uint256, CCoins> to CCoinsMap
This makes it possible to switch to a more efficient map type
without changing all occurences manually.

Merges half of #4413.
2014-07-01 12:48:16 +02:00
Philip Kaufmann 8d9cc7d743
fix copyright string in two of our *.rc files
- also make comment about rc-files in clientversion.h generic

Merges #4429.
2014-07-01 12:13:37 +02:00
Wladimir J. van der Laan 9aaa1cadf4
Merge pull request #4397
5d59921 add missing BOOST_FOREACH indentation in ThreadSocketHandler() (Philip Kaufmann)
9e9ca2b small cleanup of #ifdefs in BindListenPort() (Philip Kaufmann)
2014-07-01 09:54:41 +02:00
Wladimir J. van der Laan 3faf1f8294
test: Fix warning about integer signedness in P2SH tests 2014-06-30 16:37:59 +02:00
Wladimir J. van der Laan 5c184cb850
Merge pull request #4415
e35b37b RPC client: Simplify command line string-to-JSON-value conversion code (Jeff Garzik)
2014-06-30 15:56:01 +02:00
Wladimir J. van der Laan 77888d68d5
Fix the build for Qt5
Merging #3883 broke the Qt5 build, define the color in the standard
way.
2014-06-30 15:44:55 +02:00
Gavin Andresen 8ceb28afc3 Merge pull request #3883 from dgenr8/first_double_spend
Relay and alert user to double spends
2014-06-30 08:35:12 -04:00
Gavin Andresen 6fba25ef26 Merge pull request #4420 from sipa/skiplist
Add a skiplist to the CBlockIndex structure.
2014-06-30 08:21:46 -04:00
Wladimir J. van der Laan ac26571d2b
Merge pull request #4437
de79aaa Move non-trivial uint256.h methods to uint256.cpp (Pieter Wuille)
2014-06-30 11:27:46 +02:00
Pieter Wuille 236982c2b6 Add skiplist unit tests 2014-06-29 21:51:55 +02:00
Pieter Wuille c9a0918330 Add a skiplist to the CBlockIndex structure.
This allows fast (O(log n)) access to far predecessor blocks.
Use it to speed up CChain::FindFork and CChain::GetLocator.
2014-06-29 21:51:54 +02:00
Pieter Wuille aa81564700 Track peers' available blocks 2014-06-29 21:50:55 +02:00
kazcw 16f33f163d fix RPC error replies
After pull #4288, RPC messages indicating errors have a Content-Length unrelated
to their actual contents, rendering bitcoin-cli and curl unable to decode the
reply.

This patch sets the Content-Length field based on the actual content returned.

Additionally, pull #4288 clobbered the error descriptions provided in
ErrorReply, which bitcoin-cli relies upon; this patch moves #4288 http-error
descriptions to an HTTPError method, allowing HTTPReply to pass content on
unchanged.
2014-06-28 19:16:15 -07:00
Pieter Wuille de79aaa7a9 Move non-trivial uint256.h methods to uint256.cpp 2014-06-28 18:02:42 +02:00
Wladimir J. van der Laan 7b8fc9d8ad
Merge pull request #4436
675bcd5 Correct comment for 15-of-15 p2sh script size (Michael Ford)
2014-06-28 15:09:15 +02:00
Wladimir J. van der Laan c8b6c0a2cf
Merge pull request #4425
6ecf3ed Display unknown commands received. (R E Broadley)
2014-06-28 15:07:51 +02:00
Wladimir J. van der Laan 9125ef9421
Merge pull request #4398
86fe1b8 update coding.md to reflect changes by pull (Philip Kaufmann)
e10dcf2 ensure clean and consistent "namespace" usage (Philip Kaufmann)
2014-06-28 15:06:18 +02:00
Michael Ford 675bcd5892 Correct comment for 15-of-15 p2sh script size
The original comment forgets to account for the script push which will
need an OP_PUSHDATA2 + 2-bytes for the 513 script bytes.

props davecgh
fixes #4224
2014-06-28 20:57:46 +08:00
jtimon 645d497aa0 Replace HexBits with strprintf 2014-06-28 13:19:14 +02:00
Wladimir J. van der Laan ba81f45607
Merge pull request #3990
0dd5d3a Show only one zero instead of many when getblocks request received with a hashStop of uint256(0) (R E Broadley)
2014-06-28 10:16:09 +02:00
R E Broadley 6ecf3edfee Display unknown commands received. 2014-06-28 10:02:19 +07:00
R E Broadley 0dd5d3a009 Show only one zero instead of many when getblocks request received with a hashStop of uint256(0) 2014-06-28 09:55:24 +07:00
Tom Harding 7a19efe040 Formatting, spelling, comment fixes. 2014-06-27 16:47:33 -07:00
Wladimir J. van der Laan dfaa35d8cd
Merge pull request #4430
33c62c9 set shutdown title to main window title (Philip Kaufmann)
2014-06-27 18:53:11 +02:00
Tom Harding 9004798e62 Add -respendnotify option and new RPC data
-respendnotify=<cmd> Execute command when a network tx respends wallet
tx input (%s=respend TxID, %t=wallet TxID)

Add respendsobserved array to gettransaction, listtransactions, and
listsinceblock RPCs.  This omits the malleated clones that are included
in the walletconflicts array.

Add RPC help for respendsobserved and walletconflicts (help was missing
for the latter).
2014-06-27 07:54:21 -07:00
Tom Harding ada5a067c7 UI to alert of respend attempt affecting wallet.
Respend transactions that conflict with transactions already in the
wallet are added to it.  They are not displayed unless they also involve
the wallet, or get into a block.  If they do not involve the wallet,
they continue not to affect balance.

Transactions that involve the wallet, and have conflicting non-equivalent
transactions, are highlighted in red.  When the conflict first occurs, a
modal dialog is thrown.

CWallet::SyncMetaData is changed to sync only to equivalent transactions.

When a conflict is added to the wallet, counter nConflictsReceived is
incremented.  This acts like a change in active block height for the
purpose of triggering UI updates.
2014-06-27 07:54:21 -07:00
Tom Harding d640a3ceab Relay double-spends, subject to anti-DOS
Allows network wallets and other clients to see transactions that respend
a prevout already spent in an unconfirmed transaction in this node's mempool.

Knowledge of an attempted double-spend is of interest to recipients of the
first spend.  In some cases, it will allow these recipients to withhold
goods or services upon being alerted of a double-spend that deprives them
of payment.

As before, respends are not added to the mempool.

Anti-Denial-of-Service-Attack provisions:
 - Use a bloom filter to relay only one respend per mempool prevout
 - Rate-limit respend relays to a default of 100 thousand bytes/minute
 - Define tx2.IsEquivalentTo(tx1): equality when scriptSigs are not considered
 - Do not relay these equivalent transactions

Remove an unused variable declaration in txmempool.cpp.
2014-06-27 07:54:21 -07:00
Tom Harding 8fbf03995d CBloomFilter::clear() method 2014-06-27 07:54:21 -07:00
Gavin Andresen 6259937388 Merge pull request #4365 from gavinandresen/relax_isstandard
Relax IsStandard rules for pay-to-script-hash transactions
2014-06-27 10:53:24 -04:00
Philip Kaufmann 33c62c9c0b set shutdown title to main window title
- this ensures we don't show Bitcoin-Qt as that is still our
  internal application name
- fixes #4427
2014-06-27 15:09:41 +02:00
Wladimir J. van der Laan 4684c883bb
Merge pull request #4208
6a5c124 [Qt] don't allow translation of our example btc address (Philip Kaufmann)
2014-06-27 12:46:49 +02:00
Philip Kaufmann 40a158e100 minor code format fix in rpc-related files 2014-06-27 11:13:25 +02:00
Wladimir J. van der Laan d77f761be9
Merge pull request #4288
ed5769f Move AcceptedConnection class to rpcserver.h. (Jeff Garzik)
854d013 RPC code movement: separate out JSON-RPC execution logic from HTTP server logic (Jeff Garzik)
c912e22 RPC cleanup: Improve HTTP server replies (Jeff Garzik)
2014-06-27 10:03:19 +02:00
Jeff Garzik ed5769f536 Move AcceptedConnection class to rpcserver.h.
Also, add parens to HTTPReply() to assist readability.
2014-06-27 00:10:53 -04:00
Jeff Garzik 854d013012 RPC code movement: separate out JSON-RPC execution logic from HTTP server logic 2014-06-26 23:32:18 -04:00
Jeff Garzik c912e22db0 RPC cleanup: Improve HTTP server replies
1) support varying content types
2) support only sending the header
3) properly deliver error message as content, if HTTP error
4) move AcceptedConnection class to header, for wider use
2014-06-26 23:32:18 -04:00
Jeff Garzik e35b37b1b8 RPC client: Simplify command line string-to-JSON-value conversion code
By default, all command line parameters are converted into JSON string
values.  There is no need to manually specify the incoming type.

A binary decision "parse as string or JSON?" is all that's necessary.

Convert to a simple class, initialized at runtime startup, which offers
a quick lookup to answer "parse as JSON?" conversion question.

Future parameter conversions need only to indicate the method name
and zero-based index of the parameter needing JSON parsing.
2014-06-26 22:18:30 -04:00
Whit J c598f2acdb Fixed captitalization in bitcoin-cli-res.rc 2014-06-26 18:31:40 -07:00
Wladimir J. van der Laan 236ae8665e
Merge pull request #3715
e44fea5 Add an option to allow users to disable relaying/mining data carrier transactions (Luke Dashjr)
2014-06-26 17:31:12 +02:00
Wladimir J. van der Laan eacff4a9c6
Merge pull request #4392
8ae973c Allocate more space if necessary in RandSeedAddPerfMon (Wladimir J. van der Laan)
be873f6 Issue warning if collecting RandSeed data failed (Wladimir J. van der Laan)
fcb0a1b change "char pch[200000]" to "new char[200000]" (daniel)
2014-06-26 17:11:53 +02:00
Luke Dashjr e44fea55ea Add an option to allow users to disable relaying/mining data carrier transactions 2014-06-26 14:31:06 +00:00
Wladimir J. van der Laan ffb32acfab
Merge pull request #1583
2a72d45 JSON-RPC method: prioritisetransaction <txid> <priority delta> <priority tx fee> (Luke Dashjr)
2014-06-26 16:20:01 +02:00
Wladimir J. van der Laan 8ae973c00c Allocate more space if necessary in RandSeedAddPerfMon
Currently we use a fixed buffer of 250000 bytes to request
HKEY_PERFORMANCE_DATA. In many cases this is not enough, causing the
entropy collection to be skipped.

Use a loop that grows the buffer as specified in the RegQueryValueEx
documentation:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms724911%28v=vs.85%29.aspx

(as the size of the performance data can differ for every call, the
normal solution of requesting the size then allocating that can't work)
2014-06-26 15:15:17 +02:00
Luke Dashjr 2a72d4591f JSON-RPC method: prioritisetransaction <txid> <priority delta> <priority tx fee>
Accepts the transaction into mined blocks at a higher (or lower) priority
2014-06-26 11:49:46 +00:00
Philip Kaufmann 5d59921237 add missing BOOST_FOREACH indentation in ThreadSocketHandler() 2014-06-26 11:01:24 +02:00
Philip Kaufmann 9e9ca2b671 small cleanup of #ifdefs in BindListenPort()
- SO_NOSIGPIPE isn't available on WIN32 so merge the 2 non-WIN32 blocks
- use predefined names from header for IPV6_PROTECTION_LEVEL and
  PROTECTION_LEVEL_UNRESTRICTED
2014-06-26 11:01:23 +02:00
Philip Kaufmann e10dcf27b4 ensure clean and consistent "namespace" usage
- remove some missplaced ;
- ensure end of a namespace is clearly visible
- use same formatting when using namespace
2014-06-26 10:36:57 +02:00
Gavin Andresen a90689ff98
Remove timing-based signature cache unit test
Two changes:

First removes a unit test that fails in my development environment
(OSX, compiled -g3 with clang).

sipa says that's not terribly surprising; the CMutableTransaction change
makes signing a little more expensive but verification quicker. The unit
test timed sign+verify-uncached versus verify-cached-five-times.

He also says the test will be invalid when libsec256kp1 is integrated
(because validation is super-optimized over signing).

core.h change fixes a compiler warning (clang -Wall : CMutableTransaction defined
as struct, declared as class in script.h).
2014-06-25 14:57:21 -04:00
Wladimir J. van der Laan 75c82d4923 Move coins.cpp and keystore.cpp to libbitcoin_common
Prepare for introduction of `bitcoin-tx` tool.
2014-06-25 10:31:35 +02:00