Andreas Schildbach
d4df1119de
SegwitAddress: Import Script rather than Script.ScriptType.
2019-05-05 16:59:28 +02:00
Matthew Leon
c87f4b3f77
SegwitAddress: Don't encode witness version to OP_N when constructing.
...
This bug was never exposed outside the SegwitAddress class (and thus can't be tested) because the encode method is only ever called by fromHash, where the script version is always set to 0.
Nevertheless, this bug could result in faults in future code, as other witness program versions begin to be used: The other construction methods, such as fromBech32(), leave the version byte as a simple representation of the version number. This means that, were the SegwitAddress constructor ever called with a non-0 version number, getWitnessVersion() would return an incorrect result, and ScriptBuilder.createOutputScript() would fail, re-running encodeToOpN() on the now greater-than-16 version byte.
2019-05-05 10:49:14 +02:00
Andreas Schildbach
106e2c8baa
Use Bouncy Castle's Scrypt implementation rather than the standalone library.
...
Amazingly, on a Pixel 2 this implementation is a bit quicker than Will Glozer/Colin Percival's native code.
2019-05-04 15:28:41 +02:00
Andreas Schildbach
7d973c8487
DeterministicKeyChain: Add getter for rootKey.
2019-05-03 23:14:39 +02:00
Andreas Schildbach
d94380caec
KeyChainFactory: Remove unused key and firstSubKey parameters from all factory methods.
2019-05-03 23:02:37 +02:00
Andreas Schildbach
82aed48962
ChildKeyDerivationTest: Fix second testcase of testChildKeyDerivation() is never tested.
2019-05-03 22:59:58 +02:00
Andreas Schildbach
1a8e4c9978
HDKeyDerivation: Add convenience methods deriveChildKeyFromPrivate() and deriveChildKeyFromPublic().
...
Also add extensive testing.
2019-05-03 22:55:20 +02:00
Andreas Schildbach
701fc38c00
HDKeyDerivation: Make precondition message more clear in deriveChildKeyBytesFromPublic().
2019-05-03 22:50:37 +02:00
Andreas Schildbach
283d5fd27b
WalletTest: More testing in roundTrip().
2019-05-03 11:13:19 +02:00
Andreas Schildbach
6035608b02
Deprecate Transaction.MIN_NONDUST_OUTPUT and NetworkParameters.getMinNonDustOutput(). Remove DefaultRiskAnalysis.MIN_ANALYSIS_NONDUST_OUTPUT.
...
The dust threshold has always been dependent on the actual output script type. Even more so with the
SegWit discount. So use TransactionOutput.getMinNonDustValue() or .isDust().
2019-05-02 10:36:32 +02:00
Tim Strasser
9cf13d2931
ScriptPatternTest: Split testCommonScripts() into smaller tests.
2019-04-30 12:17:02 +02:00
Andreas Schildbach
40eff8cba2
UTXOsMessage: Clarify a comment.
2019-04-30 12:11:51 +02:00
Tim Strasser
9aa6f239ea
PrefixedChecksummedBytesTest: Use proper mocking around class to test.
2019-04-30 11:57:10 +02:00
Oscar Guindzberg
56358f8ab5
Script: Add links to new methods replacing deprecated methods.
2019-04-29 10:34:16 +02:00
Oscar Guindzberg
84a8446a2f
TransactionConfidence: Fix typo in JavaDoc.
2019-04-29 10:31:12 +02:00
Sean Gilligan
46195cd24e
wallet-template: Put wallet data files in app data directory.
...
Previously WalletTemplate would store the .spvchain and .wallet files
in the app’s current working directory which could vary depending upon
how the app was launched.
This PR stores the app’s data files in the “app data directory” which
is always named “WalletTemplate” (APP_NAME) and located in the standard
location for application data directories on the current OS platform.
For macOS: `~/Library/Application Support/WalletTemplate`
For Linux/unix: `~/.WalletTemplate`
For Windows: ${APPDATA}/WalletTemplate (where APPDATA is a standard
Windows environment variable)
Changes:
* Added AppDataDirectory class to return current dir Path
* Modified Main to use appDataDirectory rather than “.”
2019-04-29 10:29:45 +02:00
Andreas Schildbach
c168e67703
Wallet: Implement witness fee discount.
...
Fee is now specified in virtual (kilo)bytes. For non-segwit transactions a virtual byte is the same as a byte so the change is backward compatible.
2019-04-29 10:03:04 +02:00
Andreas Schildbach
2fc1b1131c
Transaction: Move sizes to top in toString(), and print the weight too.
2019-04-29 09:31:56 +02:00
Andreas Schildbach
c97ecf6046
Transaction: Add methods for calculating transaction weight and virtual transaction size.
2019-04-28 19:16:50 +02:00
Andreas Schildbach
6d7866d476
TestWithWallet: Use proper key and address derivation for test wallet.
2019-04-28 19:16:06 +02:00
Andreas Schildbach
25f36872d5
TransactionOutput: Consider the witness discount in getMinNonDustValue().
2019-04-28 15:22:53 +02:00
Andreas Schildbach
fb353d744e
Fix unbalanced <p> tags in JavaDocs.
2019-04-28 13:48:37 +02:00
Sean Gilligan
88dd0028cd
ClickableBitcoinAddress: Break out QRCodeImages utility class for QR Code FX image creation.
2019-04-24 11:21:12 +02:00
Matthew Leon
1ad473ba49
LegacyAddressTest: Eliminate redundant 'throws'.
2019-04-24 10:38:21 +02:00
Sean Gilligan
2dbe4f21bc
Use TestNet3 in WalletTemplate.
...
WalletTemplate is not a production-ready wallet and (for now, at least)
should default (currently hard-coded) to TestNet3.
2019-04-23 17:12:38 +02:00
Matthew Leon
7f72faed3e
Transaction: Simplify error checking in verify().
2019-04-23 12:03:33 +02:00
Matthew Leon
48cfd8c816
WalletTest: Fix two deprecated method invocations.
2019-04-23 11:54:21 +02:00
Matthew Leon
6378d3829d
LegacyAddress: Update outdated JavaDoc reference.
...
It suggests using a deprecated method.
2019-04-23 09:51:55 +02:00
Andreas Schildbach
f83f8187d6
wallet-tool-help.txt: Move description of fee options to general options section.
2019-04-22 19:19:22 +02:00
Jakob Janecek
f2e59611f1
Block: Access transactions via getter rather than directly through the field.
2019-04-22 17:03:31 +02:00
Sean Gilligan
c2253d2e97
MainController: Replace EasyBind with two static methods.
...
This removes the dependency on EasyBind.
2019-04-22 09:06:09 +02:00
Tiberiu Nitan
537b244bfa
BuildCheckpoints: Wrap streams in try/finally block to avoid possible resource leaks.
2019-04-22 08:46:28 +02:00
Andreas Schildbach
7fbc5554a3
.travis.yml: Pick several combinations of JDK version and Gradle version to use.
2019-04-21 23:43:16 +02:00
Andreas Schildbach
581c36b185
.travis.yml: Specify exact Gradle version to use.
...
Start out with version 4.10.3 because 4.10 is our requirement for building all modules, including wallettemplate.
2019-04-21 23:43:16 +02:00
Matthew Leon
a5d38dd1c1
FilteredBlockAndPartialMerkleTreeTests: Use BitcoinSerializer.makeBlock() rather than the deprecated Block() constructor.
2019-04-20 15:10:12 +02:00
Premek
c5582c89e6
LegacyAddressTest: Fix copy-paste error.
2019-04-18 17:22:26 +02:00
Matthew Leon
b6c2b0946f
TransactionOutput: Kill an unnecessary instance variable.
2019-04-18 16:49:03 +02:00
Sean Gilligan
7bfeff65f6
build.gradle: Use plugins block rather than 'apply plugin' statements.
2019-04-18 16:41:12 +02:00
Andreas Schildbach
bfeb808b3b
Require Gradle 4.4 for building.
2019-04-18 16:28:04 +02:00
Oscar Guindzberg
26b30994b8
Wallet: Rename addScriptChangeEventListener() to addScriptsChangeEventListener() and removeScriptChangeEventListener() to removeScriptsChangeEventListener(), for the sake of naming consistency.
...
This renames related class fields too.
2019-04-17 18:51:33 +02:00
Matthew Leon
73ddffb38f
Script: Ensure that non-canonical sigs result in script failure.
2019-04-17 16:17:02 +02:00
Oscar Guindzberg
a1a1f71a27
DeterministicKeyChainTest: Fix path constant name.
...
Use BIP44_COIN_1_ACCOUNT_ZERO_PATH instead of BIP44_ACCOUNT_ONE_PATH.
2019-04-16 10:02:23 +02:00
Oscar Guindzberg
98cff1d5b8
WalletAppKit: Remove redundant throws declaration.
2019-04-15 19:49:32 -03:00
Andreas Schildbach
d686d74903
Peer: Ignore incoming SendHeaders messages, because we don't announce new blocks.
2019-04-14 20:34:10 +02:00
Jakob Janecek
a00f751a56
Replace use of Utils.currentTimeMillis() with Utils.currentTimeSeconds() where appropriate.
2019-04-14 19:18:16 +02:00
Oscar Guindzberg
66289d6f39
WalletAppKit: Remove unnecessary call to KeyChainGroup.Builder.build().
2019-04-13 02:18:38 +02:00
Oscar Guindzberg
0af0439b3f
Wallet: Fix script type in deprecated findKeyFromPubHash().
2019-04-11 18:36:14 +02:00
Sean Gilligan
8a38cc3979
settings.gradle: Better document and enforce min Gradle and JDK versions for build.
...
* Create variables for min Gradle version for basic build, Java FX build
* Throw exception if Gradle less than minimum version
* Change existing println statements to print to stderr
2019-04-10 12:27:55 +02:00
Andreas Schildbach
8a19bc14e6
KeyCrypterScryptTest: Fix spurious test failure in testKeyCrypterWrongPassword().
2019-04-09 12:36:38 +02:00
Sean Gilligan
783dd45c4b
Wallet: Remove (or reduce visibility of) the deprecated constructors.
...
Replace usages in unit tests and examples with usage of the static createDeterministic() constructor.
2019-04-08 11:23:41 +02:00