FakeTxBuilder: don't create unnecessary transaction in createFakeBlock()

This commit is contained in:
Andreas Schildbach 2023-04-02 17:36:26 +02:00
parent c309994e99
commit 8a047d48b9

View File

@ -266,8 +266,7 @@ public class FakeTxBuilder {
Instant time, int height, Transaction... transactions) { Instant time, int height, Transaction... transactions) {
try { try {
Block previousBlock = previousStoredBlock.getHeader(); Block previousBlock = previousStoredBlock.getHeader();
Address to = randomAddress(previousBlock.getParams()); Block b = previousBlock.createNextBlock(null, version, time, height);
Block b = previousBlock.createNextBlock(to, version, time, height);
// Coinbase tx was already added. // Coinbase tx was already added.
for (Transaction tx : transactions) { for (Transaction tx : transactions) {
tx.getConfidence().setSource(TransactionConfidence.Source.NETWORK); tx.getConfidence().setSource(TransactionConfidence.Source.NETWORK);