3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-02-07 14:54:15 +00:00
Commit Graph

1648 Commits

Author SHA1 Message Date
Mike Hearn
fccb6f03bd WalletAppKit: allow restore from wallet seed even when there are no checkpoints i.e. regtest mode 2014-12-04 15:57:34 +01:00
Mike Hearn
625d19230d PeerGroup: don't keep trying every second when discovery returns zero peers but we have enough connections anyway. 2014-12-04 15:20:28 +01:00
Mike Hearn
7d7f826367 Fix lock inversion tags<->wallet lock. 2014-12-04 11:28:26 +01:00
Devrandom
1ba568e069 rename TxConfidencePool to TxConfidenceTable 2014-12-03 13:10:07 +01:00
Devrandom
2dfeee55b6 Clean up JavaDoc for deprecated PeerGroup.getConfidencePool 2014-12-03 13:10:07 +01:00
Devrandom
bc3a5cd845 introduce a Context object vended by AbstractBlockChain
have it hold the confidencePool
2014-12-03 13:10:06 +01:00
Devrandom
beb6f0873f Mark unrelated flaky test 2014-12-03 13:10:06 +01:00
Devrandom
b9bca58f26 Remove tx from TransactionConfidence 2014-12-03 13:10:06 +01:00
Devrandom
ec7cec67a7 Rename MemoryPool to TxConfidencePool and make singleton 2014-12-03 13:04:10 +01:00
Carlos Lopez
a2ac847ee9 Wallet.loadFromFile takes WalletExtensions 2014-12-03 13:00:57 +01:00
Kalpesh Parmar
96a82800fd 1) Update the full stores to return UTXO transactions.
2) The wallet can now use a UTXOProvider to create spends.
3) Updated MySQL field blob size.  It's capacity isn't sufficient.
4) Updated internal objects to be able to cope with a null parent tx (spend free standing outputs).
2014-12-03 12:56:07 +01:00
Bennett Hoffman
552bf3fa4d Use ArrayList instead of HashSet in DefaultCoinSelector#select. Test 2014-12-03 12:39:58 +01:00
Jarl Fransson
df00b1e27e PaymentChannelClient support encrypted wallets. Store will upgrade forward gracefully. 2014-12-02 16:28:14 +01:00
Andreas Schildbach
ad87ee9a3c Consistently use version 2.9.1 of maven-javadoc-plugin. 2014-11-24 15:01:10 +01:00
Andreas Schildbach
77dd531be4 Fix potential race condition when checking keychain for key rotation time. 2014-11-24 15:00:01 +01:00
Andreas Schildbach
acad3e985d Don't spam the log with setting key rotation time while loading wallets. Instead, print it with the wallet dump. 2014-11-24 15:00:01 +01:00
Mike Hearn
1db2316fc3 More attempts to fix build flakes. 2014-11-24 14:42:02 +01:00
Mike Hearn
bd986f35f1 Bloom filtering: check for malformed Merkle trees. Resolves issue 593. Thanks to Pieter Wiulle. 2014-11-24 13:59:42 +01:00
Mike Hearn
dfc9d3c924 Sha256Hash: remark that it takes ownership of the byte array. 2014-11-24 13:59:00 +01:00
Mike Hearn
9814a6caba Slightly different attempt to fix thread safety issue in PeerGroup to in #278 - make connectTo always locked. It used to be that we couldn't do this but there are no comments reminding me why not, and unit tests + wallettemplate seem happy with it being locked, so I think changes in the network code since then have probably removed this issue. 2014-11-24 13:33:21 +01:00
Mike Hearn
69de1f01ac ECKey/DeterministicKey: replace ECPoint with a LazyECPoint wrapper that doesn't delays parsing of key bytes into a key structure until it's needed. The process of decoding keys from the wallet previously involved decompressing/recompressing them which was taking ~seconds for hundreds of keys on Dalvik/2012 era Androids. After this patch loading such a wallet takes a few hundred milliseconds, most of which is spent inside RIPEMD160. 2014-11-24 13:16:15 +01:00
Mike Hearn
34017e16f8 TestWithPeerGroup: don't stopAsync if the peergroup isn't running and update the class description. 2014-11-24 13:04:59 +01:00
Mike Hearn
5a8ed59029 PeerGroup: Reimplement pinging to use the executor. New code is simpler and more correct. 2014-11-24 13:04:59 +01:00
Mike Hearn
e7c00df740 Replace peerGroup.startAsync/awaitRunning with start() and awaitTerminated with stop(). 2014-11-24 13:04:58 +01:00
Mike Hearn
10340b13a6 Don't hold the peergroup lock whilst calculating bloom filters, and run on the executor thread. Move responsibility for deduplication into recalculateFastCatchupAndFilter(). 2014-11-24 13:04:58 +01:00
Mike Hearn
27bc229fab Rewrite how peer group manages connections and its internal thread:
- No longer uses Guava services, the change is source compatible but the two-step API is no longer needed

- Now has a dedicated ScheduledExecutorService as its core service thread, so we can schedule jobs for the future instead of using sleeps.

- Connection code was rewritten to be easier to follow (at least I think so).

The goal here is to generalise the peer group thread so it can do more things.
2014-11-24 13:04:58 +01:00
Mike Hearn
573b487c2b WAK: add note in javadoc about missing feature. 2014-11-24 13:04:42 +01:00
Andreas Schildbach
e12930c00f Fix formatting dates at several places. Common mistakes:
- DateFormats are not thread safe
- new Date() is used for formatting which does not specify a locale

We now use a Utils.dateTimeFormat() helper for formatting to ISO 8601 (UTC).
2014-11-19 16:50:00 +01:00
Oscar Guindzberg
28d0743dd6 Update Script.getPubKeyHash() javadoc 2014-11-17 17:03:38 -03:00
Mike Hearn
5c908a86f1 Fix Orchid hash again 2014-11-17 17:23:15 +01:00
Mike Hearn
a2e9806f2f Update Orchid version and POM to reflect the dirauth change. 2014-11-17 14:05:20 +01:00
Andreas Schildbach
12750b5840 Fix another Java 6 compat issue. 2014-11-14 23:47:22 +01:00
Andreas Schildbach
cdc1a4ce99 Fix just asking Wallet.doMaintenance() for if maintenance needs to be done wastes addresses. 2014-11-14 23:25:58 +01:00
Mike Hearn
533489ed78 Java 6 compat to unbreak the build 2014-11-14 18:32:51 +01:00
Matt Corallo
ef0ae01b75 Some block-tester refactors, and a new large-reorg test (1008 blks) 2014-11-14 17:57:58 +01:00
Matt Corallo
d78e9b053a Exit after fail + 5 rules 2014-11-14 17:57:57 +01:00
Matt Corallo
d37bba6393 Partially revert feba3, remove non-deterministic sigs, timeout 2014-11-14 17:57:57 +01:00
Matt Corallo
3398216449 Fix potential headers-first NPE race 2014-11-14 17:57:57 +01:00
Matt Corallo
b0b8eb28d3 Why, oh why have I not rewritten this damn thing yet? 2014-11-14 17:57:57 +01:00
Matt Corallo
adf4a61836 Add test for the other half of b56 2014-11-14 17:57:57 +01:00
Matt Corallo
fed5891ef8 Remove UTXO rules which test non-existant protocol rules 2014-11-14 17:57:57 +01:00
Matt Corallo
ce41c10a9e Fix missing spendable coinbase 2014-11-14 17:57:57 +01:00
Matt Corallo
c824bd4491 Missed b89 and some spendableOutputs 2014-11-14 17:57:57 +01:00
Matt Corallo
718c0b61c2 Add OP_RETURN tests to expose bug on master (thanks gmaxwell)
(and fix rebase issues)
2014-11-14 17:57:57 +01:00
Matt Corallo
1740ec6750 Fix OOM issues introduced by recent changes. 2014-11-14 17:57:57 +01:00
Matt Corallo
2780b3f9b7 Fix height in large-reorg test 2014-11-14 17:57:57 +01:00
Matt Corallo
8284e1cfbc Fix b49 duplicate hash error 2014-11-14 17:57:57 +01:00
Dave Collins
0eb4b23031 Add test for invalid opcode in dead execution path.
Bitcoind only errors when an invalid opcode in a transaction script is
actually executed.  This commit adds a test case to ensure this
behavior is the same between different implementations.

Conflicts:
	core/src/test/java/com/google/bitcoin/core/FullBlockTestGenerator.java
2014-11-14 17:57:57 +01:00
Dave Collins
18f03c15d6 Correct spend output comments for b77-b82. 2014-11-14 17:57:57 +01:00
Matt Corallo
ac65d91eec Fix block tester and (possibly) make it work with headers-first 2014-11-14 17:57:57 +01:00
Matt Corallo
05a67aef92 Keep track of hash->block mappings
Conflicts:
	core/src/test/java/com/google/bitcoin/core/FullBlockTestGenerator.java
2014-11-14 17:57:57 +01:00
Matt Corallo
4247bc75f6 Help BitcoindComparisonTool work with getheaders requirements 2014-11-14 17:57:57 +01:00
Mike Hearn
ccbd30da8f Delete !notfound code paths. 2014-11-14 17:33:01 +01:00
Andreas Schildbach
f410201342 Fix missing WalletExtensionsTest.tearDown(). This caused a corrupt Wallet.SendRequest.DEFAULT_FEE_PER_KB. 2014-11-14 17:09:36 +01:00
Andreas Schildbach
ae48f18641 Set up encrypted wallet only in tests that need it. Should speed up unit tests a bit. 2014-11-14 17:09:36 +01:00
Andreas Schildbach
91f3d23165 Tests for completing transactions with non-standard fees. 2014-11-14 17:09:36 +01:00
Andreas Schildbach
b7166d650d Print fee with Transaction.toString(), if known. 2014-11-14 17:09:36 +01:00
Andreas Schildbach
40b46f0326 Remove IOException from TestWithWallet. 2014-11-14 17:09:36 +01:00
Andreas Schildbach
53688cde60 Replace duplicated "current wallet version" constant by code that looks it up from the .proto itself. 2014-11-14 17:08:51 +01:00
Mike Hearn
20955814bb Same change for Fiat.parseCoin 2014-11-14 16:52:09 +01:00
Giannis Dzegoutanis
683c50b3fa made Coin.parseCoin method to throw an IllegalArgumentException instead of an ArithmeticException in cases of fractional satoshis 2014-11-14 16:46:21 +01:00
Adam Mackler
e2b00e4cda Clarify javadoc comments regarding whether HD derivations are hardened. 2014-11-14 16:43:20 +01:00
Mike Hearn
17fae952a7 Move NetworkParameters to first argument in DeterministicKey serialize/deserialize methods, it's more conventional that way. 2014-11-14 16:42:14 +01:00
Wojciech Langiewicz
41f8f5ccb4 Addes NetworkParams as a parameter to DeterministicKey serialization/deserialization. 2014-11-14 16:34:19 +01:00
Mike Hearn
4b31e6c56e Minor cleanup in a wallet unit test 2014-11-14 14:01:30 +01:00
Mike Hearn
b7bac50fa1 Fix a bug in the BIP 62 handling code that can cause a crash for any broadcast multisig transaction. 2014-11-14 14:01:26 +01:00
Mike Hearn
199a741850 Add an OP_RETURN convenience method on ScriptBuilder and convert unit tests to use it. 2014-11-14 14:01:21 +01:00
Mike Hearn
f65da9c201 Fix a wrong lock, spotted by Andreas 2014-11-13 22:51:33 +01:00
Mike Hearn
b578adf55d Wallet: give up on using read/write locks for the keychain, the re-entrancy rules are too hard to follow. Switch back to a regular lock. 2014-11-13 22:30:35 +01:00
Mike Hearn
4d99313814 Delete EncryptedPrivateKey, it's cruft left over from the HD wallets work. 2014-11-11 16:59:49 +01:00
Wojciech Langiewicz
aafb15a24f Adds one test to the CHECKMULTISIG feature which was failing before 2014-11-10 22:34:23 +01:00
Wojciech Langiewicz
b279c40801 Adds Wallet tests, extracts FooWalletExtension for testing. 2014-11-09 15:49:33 +01:00
Wojciech Langiewicz
e830ab87b0 pom.xml update to exclude untestable classes from coverage report 2014-11-09 15:49:33 +01:00
Mike Hearn
f6d5644108 Remind myself how to run the postgres unit tests. 2014-11-09 15:49:23 +01:00
Kalpesh Parmar
eed5f22550 Bug fix: The database access code was not updated on field value type change. 2014-11-09 15:32:48 +01:00
Kalpesh Parmar
9004166122 1) Fixed the height field to store the height for both coinbase/non coinbase open outputs.
2) Thanks to Ed Lee - Fixed Issue 447 : H2 store: block header hash code is off by 4 bytes. This fix also applies to Postgres and MySQL stores.
3) Added a coinbase field to the openoutputs table and updated code to use this value.
4) Updated field type of ‘value’ in the openoutputs table from bytes to long.
5) Updated the stores (DatabaseFullPrunedBlockStore) with a compatibility check.
6) Updated field type of ‘addresstargetable’ in the openoutputs table from int to tinyint/smallint.
2014-11-09 15:32:48 +01:00
Kalpesh Parmar
fbf62614b4 1) Re-factored PostgresFullPrunedBlockStore and H2FullPrunedBlockStore into a generic DatabaseFullPrunedBlockStore class.
2) H2FullPrunedBlockStore now supports calculateBalanceForAddress() method.
3) Created an additional store for MySQL (MySQLFullPrunedBlockStore) and unit test.
4) Fixed unit test PostgresFullPrunedBlockStoreTest, second time execution was failing due to not clearing down the tables correctly.
5) Added methods getOpenTransactionOutputs() & deleteStore() to base class DatabaseFullPrunedBlockStore.
2014-11-09 15:32:48 +01:00
Mike Hearn
580a67c0b7 PeerGroup: add a removePeerFilterProvider to complement add. 2014-11-08 22:35:12 +01:00
Adam Mackler
b36169caba Make TransactionBroadcast recognize network rejection of transmitted transaction. 2014-11-08 19:57:41 +01:00
Andreas Schildbach
7419556717 When reading wallets, catch another possible data inconsistency and throw UnreadableWalletException. 2014-11-08 18:04:36 +01:00
Mike Hearn
e16c357723 Fix another license header. 2014-11-07 18:02:47 +01:00
Andreas Schildbach
c2611b5345 Fix question marks could not be used in payment protocol request URI. Removes the check for multiple question marks in the bitcoin URI.
Also see https://github.com/schildbach/bitcoin-wallet/issues/169
2014-11-07 11:15:58 +01:00
Mike Hearn
6dbc918876 Fix license headers in BitcoinURI/BitcoinURIParseException 2014-11-06 13:30:40 +01:00
Mike Hearn
8b9d1903c5 PeerGroup: add/remove listeners from active/pending peers as well as the internal list. 2014-11-05 18:42:14 +01:00
Mike Hearn
0d5a542f22 Wallet extension: fix a regression introduced by e3a13a6, where in some kinds of app wallet extensions stopped being loaded properly. 2014-11-05 16:37:33 +01:00
Wojciech Langiewicz
dd37fe90c6 Issue 586 fixed, 0BTC transaction with OP_RETURN will work. 2014-11-05 15:30:05 +01:00
Mike Hearn
855fd2832f Immediately advance current addresses instead of doing it lazily. This avoids a bug whereby an app might quit after using a change address, thus currentKey(CHANGE) == null and it gets reset to the last used address when the wallet is round-tripped.
Unit tests didn't catch this because they didn't simulate the app terminating after the send, and weren't explicitly checking that the change address was different, so improve tests to do those things.

Additionally implement marking as used for married wallets.
2014-11-04 23:21:23 +01:00
Mike Hearn
903f84acc8 PeerGroup: insert filter providers at the start of the list instead of the end, to help clients avoid circular deadlock. 2014-11-04 15:11:07 +01:00
Mike Hearn
3cdb039a29 Wallet: don't save wallet and invoke event listeners when adding watched scripts if the call was a no-op. 2014-11-04 15:10:42 +01:00
Andreas Schildbach
3aac4b0025 Rewrite most references to prodnet to mainnet in the comments. Does not change any actual code. 2014-11-03 14:23:36 +01:00
Wojciech Langiewicz
8951e8814d Adds coveralls.io support via maven plugin. 2014-11-03 14:19:52 +01:00
Mike Hearn
ef4afe8e1c Change the PeerFilterProvider interface to have begin/end methods instead of requiring a lock to be exposed. It's more efficient and flexible. 2014-11-03 13:59:38 +01:00
Mike Hearn
18dd2e2b05 Fix bug revealed by static analysis. 2014-11-03 13:59:38 +01:00
Mike Hearn
f5216b1d49 Implement some missed Bloom filter application logic (does not impact existing apps). 2014-11-03 13:59:38 +01:00
Wojciech Langiewicz
387be0790c Adds JaCoCo code coverage tool. 2014-11-02 17:13:16 +01:00
Wojciech Langiewicz
c11c4d126d Fixes issue 587: disables connecting to local bitcoin node during tests 2014-11-02 16:11:43 +01:00
Oscar Guindzberg
57fc280ede Fix documentation 2014-10-31 18:14:45 -03:00
Alon Muroch
6e40d4d7cd Delete watched scripts methods. Fixed queueOnScriptsChanged threading. 2014-10-31 11:07:59 +01:00
langerhans
e5a1eb8571 Merge remote-tracking branch 'upstream/master' into rebase
Conflicts:
	core/src/main/java/com/dogecoin/dogecoinj/core/Transaction.java
	core/src/main/java/com/dogecoin/dogecoinj/core/Wallet.java
	core/src/main/java/com/dogecoin/dogecoinj/wallet/DeterministicSeed.java
2014-10-30 22:32:59 +01:00
Devrandom
207ba9fd9d Don't allow creation of seeds with null passphrase
It should be the empty string as the standard default.
2014-10-30 11:05:36 -07:00