3
0
mirror of https://github.com/Qortal/altcoinj.git synced 2025-01-31 07:12:17 +00:00
Commit Graph

1581 Commits

Author SHA1 Message Date
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
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
Jarl Fransson
e3a13a6efa When deserializing wallet extensions, lock order is now wallet and then extension. 2014-10-30 12:16:40 +01:00
Mike Hearn
af20c37a8d Use finer grained locking around the wallet keychain, to allow for fast reading of keys/the current receive address even if the wallet is busy auto saving or processing large transactions. This helps reduce UI hangs/lag on Android. 2014-10-24 17:57:58 +02:00
Wojciech Langiewicz
ee08ba4d5d Update toString() in ECKey to include private key in WIF format, adds helper methods with tests. 2014-10-23 22:53:00 +02:00
Mike Hearn
47cdf5f70e Log full tx when considered risky. 2014-10-23 17:12:14 +02:00
Mike Hearn
fbccfbbe0e Default risk analysis: fix an off-by-one error in dust output comparisons. 2014-10-23 17:11:29 +02:00
Mike Hearn
9532fa31a3 Key rotation: fix bug that could cause multiple identical key chains to be created over and over if the key rotation time was equal to the time of the oldest best key, with test coverage. 2014-10-23 15:42:34 +02:00
Mike Hearn
9239387ca7 Key rotation: add saveNow call after new HD chains might have been added. 2014-10-23 00:07:01 +02:00
Mike Hearn
d2ea42bfce doMaintenance: don't trigger signing if bool param is false, as an optimisation. 2014-10-22 22:13:05 +02:00
Mike Hearn
afb05867a9 Fix off by one in DKC.getKeys(false). Resolves #253 2014-10-22 22:00:31 +02:00
Mike Hearn
cd25e673f1 10x fee drop, now most miners seem to have upgraded to 0.9+ 2014-10-22 21:52:04 +02:00
Mike Hearn
d4ffd63525 Make basicCategoryStepTest independent of actual min fee level. 2014-10-22 21:51:49 +02:00
Mike Hearn
bb138e70c3 Key rotation: also unit test the creation time of a fresh key. 2014-10-22 20:03:15 +02:00
Mike Hearn
1a55f8d2d5 Add maybeDoMaintenance back as a deprecated alias. 2014-10-22 19:43:16 +02:00
Mike Hearn
ea02436f96 Rename maybeDoMaintenance to doMaintenance and add a bit more docs. 2014-10-22 19:32:51 +02:00
Mike Hearn
ea7c29e38b Key rotation: construct new HD chain based on the oldest possible key, a la upgrade, with a fresh random HD chain only being created if all random keys are rotating. 2014-10-22 19:32:51 +02:00
Mike Hearn
77ace479d9 Key rotation: remove the enabled setting. It's no longer useful and defaulted to off, which is dangerous and can lead to bugs. 2014-10-22 19:32:51 +02:00
Jarl Fransson
db519475b2 When deserializing client payment channel state, if there was an existing close transaction, it was deserialized from wrong data. 2014-10-21 13:41:02 +02:00
Peter Dettman
bb368c9543 Improve Coin range check to cope with Long.MIN_VALUE correctly 2014-10-17 16:36:29 +02:00
Andreas Schildbach
b3f19ee0fc Replace two occurences of pom versions with ${project.version}. It makes incrementing the version a little bit less painful. 2014-10-16 15:30:32 +02:00
Andreas Schildbach
0af58eb9bb VarInt patch by "bake3978", taken from https://code.google.com/p/bitcoinj/issues/detail?id=582
Deleted unnecessary codes; long val; ... val = first; ... this.value = val; -> this.value = first;
2014-10-16 14:39:45 +02:00
Andreas Schildbach
98cc6adfc2 Sort keys by age when printing them. Also fix a generics warning. 2014-10-15 14:21:21 +02:00
eleetas
8936338059 Added check to determine if the DB connection has been closed. If yes, then get a new connection. 2014-10-14 11:09:01 -07:00
Andreas Schildbach
ca2a9ed8f1 Fix one unexpected case of fiatToCoin overflow and add tests. 2014-10-12 19:25:52 +02:00
Andreas Schildbach
8c99e61e01 Add missing JavaDocs for ExchangeRate. 2014-10-12 19:11:04 +02:00
Adam Mackler
1a476af542 Overload HD Key deserialization methods with single-argument versions that use a null parent. 2014-10-10 14:31:49 +02:00
Adam Mackler
b37c87c7af Add javadoc comment for VersionedChecksummedBytes.toString(). 2014-10-10 14:31:35 +02:00
Oscar Guindzberg
2010614fd6 Add/Remove wallets to the connected peers as they are added/removed
to/from the PeerGroup
2014-10-09 14:05:16 -03:00
Mike Hearn
a24f5cb5ba PeerGroup improvements:
1) Don't hold the PeerGroup lock across DNS discovery, otherwise the API is high latency in this period of startup. Fixes issue in Lighthouse where the UI would not appear until DNS resolution had completed.

2) Don't backoff peers that failed due to a first-time connection error.

3) If an IPv6 peer fails to connect due to a NoRouteToHostException, don't try any more IPv6 peers in future.
2014-10-09 13:11:32 +02:00
Andreas Schildbach
113d7bc445 Fix duplicate 'BTC' in log message. 2014-10-07 23:51:54 +02:00
Mike Hearn
c9830cca52 Change TransactionConfidence.getBroadcastBy() to return a set instead of a list iterator. The latter form is not very convenient. 2014-10-07 19:26:10 +02:00
Mike Hearn
059b2679a7 Suppress noisy log line that is duplicated by LocalTransactionSigner. 2014-10-07 16:14:06 +02:00
Devrandom
38344465f0 Cleanup DKC serialization 2014-10-07 15:39:04 +02:00
Devrandom
22f0600afe Refactor married keychains
* move handling of following keychains into the leading keychain
* move multisig threshold into the leading keychain
* extract MarriedKeyChain from DeterministicKeyChain
2014-10-07 15:39:04 +02:00
Mike Rosseel
be496b95a3 Implement better support for multiple peer discoveries. Resolves issue 302. 2014-10-07 15:33:58 +02:00
Adam Mackler
2834b7730f Don't fail when deserializing a parentless HD key having depth greater than one.
Currently, deserializing an HD key will fail if both (1) the parent object is null, and
(2) the hierarchy depth is greater than one.  This patch changes that; rather than
throwing an exception, the parent is considered to be the root of the deterministic hierarchy.
2014-10-07 15:27:49 +02:00
Mike Hearn
cc8925ed0f Integrate checkpoints into WalletAppKit so they're used by default in the non-Android context. 2014-10-07 15:16:39 +02:00
Mike Hearn
99de477c0d Extend exception message to help track down flaky test. 2014-10-07 13:47:02 +02:00
Sebastian Ortega
42f9d7c193 Use daemon threads on FullPrunedBlockChain
This way, the thread pool used to run the transaction scripts won’t
prevent applications from exiting.
2014-10-07 12:01:00 +02:00
Mike Hearn
83995e9284 Suppress noisy log line during signing. 2014-10-06 13:57:45 +02:00
Mike Hearn
4a27afaac0 Clear static analysis warning: null check is useless at this point. 2014-10-06 13:57:37 +02:00
Mike Hearn
9dcc4ed6f4 0.13-SNAPSHOT 2014-10-05 20:38:00 +02:00
Mike Hearn
83a9a71f3f bitcoinj 0.12 2014-10-03 00:46:31 +02:00
Mike Hearn
6f22cba76f Maven changes to support auto upload of snapshot versions, better javadocs etc. 2014-10-02 14:22:25 +02:00
Mike Hearn
0914c82f69 Add package-info files for the javadocs. 2014-10-02 13:55:22 +02:00
Andreas Schildbach
6612e1e1ce Reduce spamminess of message telling us that a script flag isn't handled yet. 2014-10-02 13:47:24 +02:00
Andreas Schildbach
9e4043d9bb Change groupId of Orchid artifact to "org.bitcoinj". This makes uploads to Maven Central easier for us. 2014-10-01 20:27:01 +02:00
Mike Hearn
4172bbcbe1 Script: Add MAX_P2SH_SIGOPS constant. 2014-10-01 16:21:08 +02:00
Mike Hearn
596f7cff04 Add a ScriptChunk.decodeOpN method. 2014-10-01 15:54:55 +02:00
Mike Hearn
ba4aeff2a5 Script: expose execute publicly 2014-10-01 15:54:42 +02:00
Mike Hearn
a8f85d1158 DefaultRiskAnalysis: extract output testing into a separate method also, and add a (presently unused) new rule violation type. 2014-10-01 15:54:31 +02:00
Mike Hearn
5fc98d2c07 Extract input standardness check into a separate callable method. 2014-10-01 14:14:34 +02:00
Mike Hearn
c5a564e152 Make the ScriptBuilder API a bit more flexible and better documented. 2014-10-01 14:14:15 +02:00
Mike Hearn
1da4002a4b Fix toString in payment channels for Coin conversion 2014-09-30 18:26:36 +02:00
Mike Hearn
9c12d73d12 Fix build 2014-09-30 18:24:19 +02:00
Mike Hearn
0a6f901b23 Renamespace to org.bitcoinj away from com.google.bitcoin, as bitcoinj is no longer a Google project and being namespaced under com.google causes issues with Sonatype/Maven Central.
To fixinate your code:

find . -name '*.java' | xargs sed -i .bak 's/import com.google.bitcoin./import org.bitcoinj./g;s/import static com.google.bitcoin./import static org.bitcoinj./g'
2014-09-30 17:05:07 +02:00
Giannis Dzegoutanis
48de05ac0f Separate Transaction and Wallet classes 2014-09-30 15:41:13 +02:00