Commit Graph

9285 Commits

Author SHA1 Message Date
Simon
805344dcf4 Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
Simon
6c79b9a12a Update txid gtest to verify #1144 has been removed: GetTxid() and
GetHash() return the same result.
2016-09-07 15:12:09 -07:00
Simon
a64f681f2c Remove #1144 from input data of script_tests.
Revert script_invalid.json to commit df1609f.
Revert script_valid.json to commit 1c54757.
2016-09-07 15:12:09 -07:00
Simon
5316bd3560 Remove #1144 from bloom_tests by reverting to commit 5012190. 2016-09-07 15:12:09 -07:00
Simon
3bdb071cc3 Remove #1144 from transaction.cpp by reverting back to commit 942bc46. 2016-09-07 15:12:09 -07:00
Simon
82f3c490b1 Remove #1144 from transaction.h.
Reverts to 4bc00dc with commits f0dab51 (snark) and f5e5707 (joinsplit) retained.
GetTxid() is now an alias for GetHash().
2016-09-07 15:12:09 -07:00
zkbot
02932fc9cc Auto merge of #1341 - ebfull:fix-checktransaction-bug, r=ebfull
Fix CheckTransaction bugs.

Closes #1319.

Does not address the name of `vpub_old` or `vpub_new`.
2016-09-07 20:22:13 +00:00
Sean Bowe
a4b00373ab Fix transaction test in test_bitcoin. 2016-09-07 13:55:31 -06:00
zkbot
c5b5d50004 Auto merge of #1342 - ebfull:remove-todo, r=ebfull
Remove TODO 808.

Closes #1309.
2016-09-07 16:55:23 +00:00
Sean Bowe
50aba0ec19 Remove TODO 808. 2016-09-05 13:03:32 -06:00
Sean Bowe
d7eeb7455b Fix CheckTransaction bugs. 2016-09-05 12:18:43 -06:00
Sean Bowe
f6b6c9bed8 Update libsnark again. 2016-09-05 12:00:50 -06:00
zkbot
b181f7032b Auto merge of #1328 - bitcartel:zc.v0.11.2.latest_1298_rest_interface, r=ebfull
Update security-warnings.md about REST interface

Closes #1298
2016-09-02 03:43:16 +00:00
zkbot
485ace0a1b Auto merge of #1311 - ebfull:cleanup-pp, r=ebfull
Deallocate the public parameters during Shutdown.

This also has it deallocated in `GenerateParams` and `test_bitcoin`. The virtual destructor probably isn't necessary but I added it just in case we need it some other time.
2016-09-02 03:03:45 +00:00
bitcartel
8962f2a902 Update security-warnings.md about REST interface 2016-09-01 11:12:48 -07:00
zkbot
2640989d9a Auto merge of #1308 - str4d:1181-getmininginfo-testnet-difficulty-rules, r=ebfull
Separate concepts of block difficulty and network difficulty in RPC

"Block difficulty" is the difficulty listed in a block's header, which in the
testnet can sometimes be min-difficulty (if time-since-last-block is too large).

"Network difficulty" is the difficulty that the network was trying to satisfy
at a particular block height. In mainnet this is always equal to the difficulty
of the solved block for that height, but in testnet the network difficulty is
derived from the last non-min-difficulty block difficulty.

This commit fixes the RPC APIs that are intended to show network difficulty, so
that on testnet they don't sometimes drop to 1.0, confusing users.

Closes #1181
2016-09-01 18:12:46 +00:00
zkbot
8a620d507f Auto merge of #1326 - str4d:1185-remove-mainnet-dns-seeds, r=ebfull
Remove mainnet DNS seeds, set checkpoint to genesis

Closes #1185
2016-09-01 13:54:52 +00:00
zkbot
a723794f81 Auto merge of #1233 - str4d:1199-note-tracking, r=str4d
Add Note tracking

This PR extends the existing transaction tracking in the wallet to track spendable Notes.

Closes #1199
2016-09-01 08:17:07 +00:00
Jack Grigg
f7d78fdde1 Fix failing test 2016-09-01 20:16:18 +12:00
Jack Grigg
57466ea652 Remove mainnet DNS seeds, set checkpoint to genesis
Closes #1185
2016-09-01 17:01:28 +12:00
Jack Grigg
00939d09ba Add test comparing GetDifficulty() with GetNetworkDifficulty() 2016-09-01 16:36:18 +12:00
Jack Grigg
695a7a8826 Separate concepts of block difficulty and network difficulty in RPC
"Block difficulty" is the difficulty listed in a block's header, which in the
testnet can sometimes be min-difficulty (if time-since-last-block is too large).

"Network difficulty" is the difficulty that the network was trying to satisfy
at a particular block height. In mainnet this is always equal to the difficulty
of the solved block for that height, but in testnet the network difficulty is
derived from the last non-min-difficulty block difficulty.

This commit fixes the RPC APIs that are intended to show network difficulty, so
that on testnet they don't sometimes drop to 1.0, confusing users.

Closes #1181
2016-09-01 15:13:05 +12:00
Jack Grigg
268bd84f9a Add coverage of the assertion inside GetNoteWitnesses() 2016-09-01 15:04:57 +12:00
Jack Grigg
73db0c12b9 Increase coverage of GetNoteDecryptor() 2016-09-01 14:44:01 +12:00
Jack Grigg
5abaca1af6 Fix the failing test! 2016-09-01 13:00:02 +12:00
Jack Grigg
ac91ebbe92 Add test showing that the witness cache isn't being serialised 2016-09-01 12:47:44 +12:00
Jack Grigg
32a103aab7 Changes after review 2016-09-01 11:48:15 +12:00
zkbot
83ec5cb87b Auto merge of #1322 - bitcartel:zc.v0.11.2.z9_1316_getblocksubsidy, r=ebfull
Closes #1315 - change to RPC getblocksubsidy

For #1315
RPC getblocksubsidy height parameter is now optional
Returns result for future block
Test has been added to verify parameter input and results
2016-08-31 21:45:11 +00:00
zkbot
54ce3c46dd Auto merge of #1323 - bitcartel:zc.v0.11.2.latest_update_payment_api_doc, r=ebfull
Update payment-api.md

Add z_getoperationresult to documentation.

@ebfull This document might be updated again with a few notes, so let's merge closer to release.  Thanks.
2016-08-31 20:06:34 +00:00
Jack Grigg
0736fa14fc Keep any existing cached witnesses when updating transactions 2016-08-31 21:16:59 +12:00
Jack Grigg
be86b6c332 Add test for GetNoteDecryptor() 2016-08-31 18:57:32 +12:00
Jack Grigg
1551db870a Add transactions to wallet if we spend notes in them 2016-08-31 18:28:00 +12:00
Jack Grigg
38a6e7a74d Set witness cache size equal to coinbase maturity duration
Both constants have the same implicit assumption: that the blockchain will very
rarely undergo a reorganisation of that size.
2016-08-31 15:26:49 +12:00
Jack Grigg
ad20f2149a mapNullifiers -> mapNullifiersToNotes for clarity 2016-08-31 15:11:35 +12:00
Jack Grigg
4086e5ce98 Replace vAnchorCache with a cache size counter
The anchor is obtained from the returned witnesses; since all witnesses are to
the same point (the latest blockchain tip), they all have the same root.
2016-08-31 15:03:42 +12:00
bitcartel
6555546edf Update payment-api.md 2016-08-30 19:57:16 -07:00
zkbot
f9c02827d4 Auto merge of #1300 - ThisIsNotOfficialCodeItsJustForks:t915-add-wformat-security.2, r=ebfull
Add -Wformat -Wformat-security

Closes #915. Supersedes #1267 (because of weird rebase/github/zkbot bug).
2016-08-30 22:31:48 +00:00
Simon
5d50130bc9 Closes #1315. RPC getblocksubsidy height parameter is now optional and
a test has been added to verify parameter input and results.
2016-08-30 15:11:07 -07:00
zkbot
835588a629 Auto merge of #1314 - str4d:fix-getblock-solution-output, r=ebfull
Output Equihash solution in RPC results as a hex string

When the Equihash solution was changed to a compact form in #1175, the block header changed from storing a vector of indices to a vector of chars. `blockToJSON()` was not updated, which meant that RPC calls like `getblock` returned the solution as a list of 1344 integers.

This PR changes `blockToJSON()` to output the Equihash solution as a hex string, identical to how it appears in the block header.
2016-08-30 18:40:19 +00:00
zkbot
6731665a12 Auto merge of #1313 - bitcartel:zc.v0.11.2.z9_1122, r=ebfull
Fixes #1122 where json_spirit could stack overflow

See #1122 for details.
2016-08-30 18:00:11 +00:00
Jack Grigg
3fac1020e7 Remove GetNoteDecryptors(), lock inside FindMyNotes() instead 2016-08-31 02:09:17 +12:00
Jack Grigg
de42390f90 Pass ZCIncrementalMerkleTree to wallet to prevent race conditions 2016-08-31 02:00:11 +12:00
Jack Grigg
3e3da44c71 Test solution output of blockToJSON() 2016-08-30 14:42:49 +12:00
zkbot
e0fa312756 Auto merge of #1307 - str4d:remove-debug-pow-code, r=ebfull
Undo debugging change from 5be6abbf84

This was unintentionally committed, and caused Equihash verification of blocks
without parents to be skipped. This only affects the genesis block on the test
network, but also causes the "time verifyequihash" benchmark to incorrectly
appear instantaneous.
2016-08-29 22:09:17 +00:00
Jack Grigg
769e031c1a Update cached incremental witnesses when the active block chain tip changes 2016-08-30 00:29:49 +12:00
Jack Grigg
be74c80deb Add caching of incremental witnesses for spendable notes 2016-08-30 00:29:49 +12:00
Jack Grigg
8db7e25c3f Create mapping from nullifiers to received notes
This is used in the same way as CTxIn.prevout (e.g. to mark transactions dirty).
2016-08-30 00:29:49 +12:00
Jack Grigg
0f1060478f Keep track of spent notes, and detect and report conflicts 2016-08-30 00:29:49 +12:00
Jack Grigg
c3a7307a69 Store mapping between notes and PaymentAddresses in CWalletTx 2016-08-30 00:29:49 +12:00
Jack Grigg
02e674555e Add wallet method for finding spendable notes in a CTransaction 2016-08-30 00:29:49 +12:00