Commit 57787946 authored by Johny George's avatar Johny George Committed by Andreas Schildbach

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.
parent c01cb2c4
......@@ -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();
}
......
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment