5 Commits

Author SHA1 Message Date
Andreas Schildbach
4c04776105 Release 0.14.3 2016-06-13 18:41:54 +02:00
Andreas Schildbach
1fbc33f85e Wallet: Fix precondition for transaction confidence of transactions in the pending pool. They can now also be IN_CONFLICT. 2016-06-13 18:38:41 +02:00
johnygeorge
5778794635 ScriptBuilder: Make OP_RETURN to allow 80 bytes.
Make OP_RETURN to allow 80 bytes instead of the previous 40 bytes.

This is to be consistent with the Bitcoin Core, which have made it back to 80 bytes.
2016-06-13 18:38:29 +02:00
Andreas Schildbach
c01cb2c42f Wallet.setTransactionBroadcaster(): Error message for precondition. 2016-06-13 18:38:02 +02:00
Andreas Schildbach
483eda4c65 Prepare 0.14.3-SNAPSHOT 2016-06-13 18:37:08 +02:00
9 changed files with 21 additions and 8 deletions

View File

@@ -22,7 +22,7 @@
<parent>
<groupId>org.bitcoinj</groupId>
<artifactId>bitcoinj-parent</artifactId>
<version>0.14.2</version>
<version>0.14.3</version>
</parent>
<artifactId>bitcoinj-core</artifactId>

View File

@@ -78,7 +78,7 @@ public class VersionMessage extends Message {
public boolean relayTxesBeforeFilter;
/** The version of this library release, as a string. */
public static final String BITCOINJ_VERSION = "0.14.2";
public static final String BITCOINJ_VERSION = "0.14.3";
/** The value that is prepended to the subVer field of this application. */
public static final String LIBRARY_SUBVER = "/bitcoinj:" + BITCOINJ_VERSION + "/";

View File

@@ -433,7 +433,7 @@ public class ScriptBuilder {
* the ledger.
*/
public static Script createOpReturnScript(byte[] data) {
checkArgument(data.length <= 40);
checkArgument(data.length <= 80);
return new ScriptBuilder().op(OP_RETURN).data(data).build();
}

View File

@@ -5068,7 +5068,9 @@ public class Wallet extends BaseTaggableObject
// Don't hold the wallet lock whilst doing this, so if the broadcaster accesses the wallet at some point there
// is no inversion.
for (Transaction tx : toBroadcast) {
checkState(tx.getConfidence().getConfidenceType() == ConfidenceType.PENDING);
ConfidenceType confidenceType = tx.getConfidence().getConfidenceType();
checkState(confidenceType == ConfidenceType.PENDING || confidenceType == ConfidenceType.IN_CONFLICT,
"Expected PENDING or IN_CONFLICT, was %s.", confidenceType);
// Re-broadcast even if it's marked as already seen for two reasons
// 1) Old wallets may have transactions marked as broadcast by 1 peer when in reality the network
// never saw it, due to bugs.

View File

@@ -2167,6 +2167,17 @@ public class WalletTest extends TestWithWallet {
wallet.completeTx(request);
}
@Test
public void opReturnMaxBytes() throws Exception {
receiveATransaction(wallet, myAddress);
Transaction tx = new Transaction(PARAMS);
Script script = ScriptBuilder.createOpReturnScript(new byte[80]);
tx.addOutput(Coin.ZERO, script);
SendRequest request = SendRequest.forTx(tx);
request.ensureMinRequiredFee = true;
wallet.completeTx(request);
}
@Test
public void opReturnOneOutputWithValueTest() throws Exception {
// Tests basic send of transaction with one output that destroys coins and has an OP_RETURN.

View File

@@ -21,7 +21,7 @@
<parent>
<groupId>org.bitcoinj</groupId>
<artifactId>bitcoinj-parent</artifactId>
<version>0.14.2</version>
<version>0.14.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -4,7 +4,7 @@
<groupId>org.bitcoinj</groupId>
<artifactId>bitcoinj-parent</artifactId>
<version>0.14.2</version>
<version>0.14.3</version>
<packaging>pom</packaging>
<modules>

View File

@@ -21,7 +21,7 @@
<parent>
<groupId>org.bitcoinj</groupId>
<artifactId>bitcoinj-parent</artifactId>
<version>0.14.2</version>
<version>0.14.3</version>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@@ -6,7 +6,7 @@
<parent>
<groupId>org.bitcoinj</groupId>
<artifactId>bitcoinj-parent</artifactId>
<version>0.14.2</version>
<version>0.14.3</version>
</parent>
<artifactId>wallettemplate</artifactId>