mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-07-31 20:11:23 +00:00
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.
This commit is contained in:
committed by
Andreas Schildbach
parent
c01cb2c42f
commit
5778794635
@@ -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.
|
||||
|
Reference in New Issue
Block a user