Commit graph

7954 commits

Author SHA1 Message Date
Jimmy Kiselak
ccc1c22301 Remove old TODO 2015-02-10 20:14:54 -05:00
Jimmy Kiselak
6f9808faff add an rpc command for getting the value of a name 2015-02-10 18:44:14 -05:00
Jimmy Kiselak
b68b97388e Merge branch 'master' of https://github.com/bitcoin/bitcoin 2015-02-10 16:21:34 -05:00
Jimmy Kiselak
e7654b8703 add best block hash to ncc trie, and remove possibility of a null base to ncc cache
ensure the ncc trie and any caches are always in sync with the current best block
by informing the trie when the block changes, and have the ncc trie persist that
in the database. check against that whenever modifying the trie.

get rid of the possibility of a CNCCTrieCache having a null base, and create a
CNCCTrie in test_bitcoin.cpp so one exists during testing.
2015-02-10 15:30:40 -05:00
Jimmy Kiselak
389a2a963e fix a few bugs and add some assertions
ncctrietests.cpp:
add test to make sure emptying the ncc trie cache results in a
default hash ("00...01")
ncctrie.cpp:
fix the ncc trie cache so that emptying it causes the root hash
to be computed as the default hash ("00...01")
fix two bugs in reading the ncc trie from disk:
all insertions were returning immediately due to parenthesis
misplacement, and the loop reading nodes from disk wasn't
terminating due to a lack of an incrementing operation
miner.cpp
fix a bug in the miner where input coins in the cache were being
spent before their txouts could be checked for NCC commands
main.cpp
add some assertions when disconnecting blocks from the active
chain, ensuring the merkle root of the ncc trie after undoing the
block is equal to the hashNCCTrie in the previous block
fix an erroneous assertion in ConnectBlock to assert the correct
expected value
change some log statements to use __func__
init.cpp
change the order of some init operations so the NCC trie is
restored from disk before the DB is verified
2015-02-10 11:19:41 -05:00
Wladimir J. van der Laan
d48ce48093
Merge #5548: [REST] add /rest/chaininfos
2c0f901 [REST] rest/chaininfos add documentation (Jonas Schnelli)
59582c8 [REST] add /rest/chaininfos (Jonas Schnelli)
2015-02-10 12:08:07 +01:00
Jimmy Kiselak
df59145787 Merge branch 'master' of https://github.com/bitcoin/bitcoin
Conflicts:
	src/main.cpp

merge in bitcoin changes. conflict in src/main.cc, where
applying tx undos was separated into its own function.
2015-02-09 10:26:35 -05:00
Wladimir J. van der Laan
a9565863e0
Merge #5629: [Qt] prevent amount overflow problem with payment requests
a651668 [Qt] prevent amount overflow problem with payment requests (Philip Kaufmann)
2015-02-09 13:50:56 +01:00
Wladimir J. van der Laan
183ca292bd
Merge #5699: Split logic to undo txin's off DisconnectBlock.
eb1c2cd Split logic to undo txin's off DisconnectBlock. (Daniel Kraft)
2015-02-09 13:22:35 +01:00
Wladimir J. van der Laan
beff11a3a1
Merge #5679: Get rid of DetectShutdownThread
28ee7e8 Get rid of DetectShutdownThread (Wladimir J. van der Laan)
2015-02-09 12:57:09 +01:00
Wladimir J. van der Laan
f69941620b
Merge #5623: Make nicer pull request merge messages
1078fb0 Make nicer pull request merge messages (BtcDrak)
2015-02-09 12:53:00 +01:00
Wladimir J. van der Laan
7225577f6b
Merge pull request #5739
f4b2078 Replace difficulty readjustment blocks with Interval() (Shaul Kfir)
2015-02-09 12:48:38 +01:00
Wladimir J. van der Laan
5cefea9c4b
Merge pull request #5764
65f10e0 fix jonasschnelli's gitian key (Jonas Schnelli)
2015-02-09 11:34:26 +01:00
Wladimir J. van der Laan
0f44672437
Merge pull request #5753
d67a642 [Qt] add bitcoin logo to about screen (Jonas Schnelli)
2015-02-09 11:34:01 +01:00
Wladimir J. van der Laan
32a8b6a9d7
Merge pull request #5770
28d4cff Sanitize command strings before logging them. (Gregory Maxwell)
2015-02-09 10:43:53 +01:00
Gregory Maxwell
28d4cff0ed Sanitize command strings before logging them.
Normally bitcoin core does not display any network originated strings without
 sanitizing or hex encoding.  This wasn't done for strcommand in many places.

This could be used to play havoc with a terminal displaying the logs,
 especially with printtoconsole in use.

Thanks to Evil-Knievel for reporting this issue.
2015-02-08 19:58:59 +00:00
Jimmy Kiselak
79be562ff2 rpc commands for browsing ncc trie, fix bugs caused by adding ncc merkle to header
create an rpc command to print the whole ncc trie
create an rpc command to search get transaction info
for a particular name
change the number of bytes in the header expected by miner.cpp
make sure the ncc merkle hash is copied to all structures that
need it
2015-02-07 12:32:05 -05:00
Wladimir J. van der Laan
fb6140b54b
Merge pull request #5721
cf008ac Acquire CCheckQueue's lock to avoid race condition (Suhas Daftuar)
2015-02-06 16:51:39 +01:00
Jonas Schnelli
65f10e0ffc fix jonasschnelli's gitian key
There where two keys in the keyfile and it also had a missing "-key" in the filename.
See: http://bitcoinstats.com/irc/bitcoin-dev/logs/2015/02/05#l1423162105
2015-02-06 11:13:38 +01:00
Jimmy Kiselak
cd3f33c1fc merge in changes from bitcoin 2015-02-05 16:02:05 -05:00
Jimmy Kiselak
b2b0bd5bb5 implement reading and writing the NCC trie to disk, create the global trie upon initialization, add and remove NCC claims when connecting and disconnecting blocks, and check block headers against the NCC merkle hash 2015-02-05 14:24:09 -05:00
Wladimir J. van der Laan
5d901d8ece
Merge pull request #5756
1cb2a00 Fix getblocktemplate_proposals test by mining one block (Suhas Daftuar)
2015-02-05 16:02:01 +01:00
Jonas Schnelli
d67a642392 [Qt] add bitcoin logo to about screen 2015-02-04 20:52:18 +01:00
Suhas Daftuar
1cb2a00cb8 Fix getblocktemplate_proposals test by mining one block
This triggers the tested node to no longer be in initial
download, allowing the call to getblocktemplate() to succeed.
2015-02-04 12:04:49 -05:00
Wladimir J. van der Laan
1c4e3f99f0
Merge pull request #5754
17115d0 fix getblocktemplate lock issue (Jonas Schnelli)
2015-02-04 17:16:56 +01:00
Jonas Schnelli
17115d0a34 fix getblocktemplate lock issue
getblocktemplate didn't have a wallet lock before #5711 and IMO there is no need for LEAVE/ENTER critical section.
2015-02-04 16:34:34 +01:00
Wladimir J. van der Laan
93b7544501
Merge pull request #5319
35f7227 Clean up wallet encryption code. (Daniel Kraft)
2015-02-04 13:56:57 +01: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
Wladimir J. van der Laan
31dedb463b
Merge pull request #5509
7f991e3 c++11: These look like user-defined literals. (Cory Fields)
5a6155c c++11: don't forward-declare types used in maps (Cory Fields)
3447cf8 c++11: MOVEONLY: break circular dependency in wallet (Cory Fields)
bbacd88 c++11: MOVEONLY: move function definitions out of the header (Cory Fields)
a2b04dd build: fix newer boost build with c++11 (Cory Fields)
2015-02-04 13:06:16 +01:00
Wladimir J. van der Laan
87ecfb0f96
Merge pull request #5711
5ebe095 Trim RPC command table (Wladimir J. van der Laan)
4401b2d Removed main.h dependency from rpcserver.cpp (Eric Lombrozo)
2015-02-04 10:23:09 +01:00
Cory Fields
7f991e364e c++11: These look like user-defined literals.
Add a space to keep the compiler happy
2015-02-03 23:31:00 -05:00
Cory Fields
5a6155ccfa c++11: don't forward-declare types used in maps 2015-02-03 23:30:59 -05:00
Cory Fields
3447cf87e2 c++11: MOVEONLY: break circular dependency in wallet
c++11 (libc++'s stdlib implementation anyway) doesn't allow for map types to be
forward-declared. for example:

class foo;
std::map<int, foo> bar; // error, foo has not been defined.
class foo{};

Since CWallet and CWalletTx are inter-dependent, but only std::map<*,CWalletTx>
is used, forward-declare CWallet instead and define CWalletTx first.

Despite the mangled git diff, this change only amounts to moving ~320 lines in
a single chunk.
2015-02-03 23:30:59 -05:00
Cory Fields
bbacd88204 c++11: MOVEONLY: move function definitions out of the header
These need to be moved out of the header in order to resolve a circular
dependency between CWallet and CTxWallet. See next commit.
2015-02-03 22:41:33 -05:00
Cory Fields
a2b04ddfe6 build: fix newer boost build with c++11 2015-02-03 22:41:01 -05:00
Daniel Kraft
eb1c2cd37f Split logic to undo txin's off DisconnectBlock.
Instead, create a separate function that applies the undo operation of a
CTxInUndo object onto a CCoinsViewCache.  This method is used from
DisconnectBlock.
2015-02-03 15:44:39 +01:00
Suhas Daftuar
cf008ac8c3 Acquire CCheckQueue's lock to avoid race condition
This fixes a potential race condition in the CCheckQueueControl constructor,
which was looking directly at data in CCheckQueue without acquiring its lock.

Remove the now-unnecessary friendship for CCheckQueueControl
2015-02-03 08:53:08 -05:00
Wladimir J. van der Laan
fcf646c9b0
Merge pull request #5286
44e9a6b Update the 'test_IsStandard' unit test (Flavien Charlon)
a930658 Change the default maximum OP_RETURN size to 80 bytes (Flavien Charlon)
2015-02-03 13:12:44 +01:00
Wladimir J. van der Laan
e5f1f5a263
Merge pull request #5732
1371e6f Change "insane" to "absurd" (referring to high fees) in text strings and identifiers. (Daira Hopwood)
2015-02-03 13:12:12 +01:00
Wladimir J. van der Laan
6ee87f9bc5
Merge pull request #5647
3ff735c Increase block download timeout base from 10 to 20 minutes. (Gregory Maxwell)
2015-02-03 10:36:44 +01:00
Wladimir J. van der Laan
4e2b1fff98
Merge pull request #5675
2d9b0b7 Fix priority calculation in CreateTransaction (Alex Morcos)
2015-02-03 10:36:01 +01:00
Wladimir J. van der Laan
41e6e4caba
Merge pull request #5713
bf6cdeb Increase coverage of DERSIG edge cases (Pieter Wuille)
819bcf9 Add RPC test for DERSIG BIP switchover logic (Pieter Wuille)
5a47811 BIP66 changeover logic (Pieter Wuille)
092e9fe Example unit tests from BIP66 (Pieter Wuille)
80ad135 Change IsDERSignature to BIP66 implementation (Pieter Wuille)
2015-02-03 10:34:53 +01:00
Wladimir J. van der Laan
9c4a5a5067
Merge pull request #5729
fdf80ea [Qt] allow unit changes for read-only BitcoinAmountField (Philip Kaufmann)
2015-02-03 09:49:26 +01:00
Wladimir J. van der Laan
f425050546
Merge pull request #5719
9fddced Avoid storing a reference passed to SignatureChecker constructors (Pieter Wuille)
858809a Use separate SignatureChecker for CMutableTransaction (Pieter Wuille)
2015-02-03 08:26:08 +01:00
Pieter Wuille
9fddceda44 Avoid storing a reference passed to SignatureChecker constructors 2015-02-02 20:19:46 -08:00
Pieter Wuille
858809a33e Use separate SignatureChecker for CMutableTransaction 2015-02-02 20:19:12 -08:00
Jimmy Kiselak
9bb4ecef2a move everything trie related into its own file, enable serialization of trie nodes and values, and create some tests for serialization 2015-02-02 20:57:53 -05:00
Shaul Kfir
f4b2078f72 Replace difficulty readjustment blocks with Interval() 2015-02-02 14:36:00 -05:00
Wladimir J. van der Laan
a62649731f
Merge pull request #5731
ee93202 Changed pronouns for correctness and inclusivity (bikinibabe)
1fa89a5 fix _code_ snippet in gitian-building.md (UdjinM6)
34c6181 Fix README link from util.sh -> util.py. (Matt Bogosian)
faf0af4 Suggest --disable-wallet when libdb_cxx headers are missing (Luke Dashjr)
5a809ef depends: fix typos (Michael Ford)
bd2b73b TRIVIAL: fix misleading comment (Vitalii Demianets)
5262fde Remove whitespaces before double colon in errors and logs (Pavel Janík)
3800135 Fix typo (Pavel Janík)
91a9fe0 Fix typo - sentence starts with capital letter (Pavel Janík)
bfc29dc Improve gitian build guide (Michael Ford)
d6bed15 remove sig_canonical.json and sig_noncanonical.json (Manuel Araoz)
8673160 Remove bootstrap.md (Michael Ford)
2015-02-02 11:56:23 +01:00
Pieter Wuille
bf6cdebdc5 Increase coverage of DERSIG edge cases 2015-02-01 17:51:25 -04:00