Fix contract creation

This commit is contained in:
nicksavers 2014-10-07 18:00:53 +02:00
parent 50f6a21ba8
commit 4093fc9e65
2 changed files with 11 additions and 9 deletions

View File

@ -175,7 +175,7 @@ public class Transaction {
}
public boolean isContractCreation() {
return Arrays.equals(this.receiveAddress, ByteUtil.EMPTY_BYTE_ARRAY);
return this.receiveAddress == null;
}
/*********

View File

@ -170,14 +170,16 @@ public class Wallet {
}
byte[] receiveAddress = transaction.getReceiveAddress();
Account receiver = rows.get(Hex.toHexString(receiveAddress));
if (receiver != null) {
receiver.addPendingTransaction(transaction);
logger.info("Pending transaction added to " +
"\n account: [{}], " +
"\n tx: [{}]",
Hex.toHexString(receiver.getAddress()), Hex.toHexString(transaction.getHash()));
if(receiveAddress != null) {
Account receiver = rows.get(Hex.toHexString(receiveAddress));
if (receiver != null) {
receiver.addPendingTransaction(transaction);
logger.info("Pending transaction added to " +
"\n account: [{}], " +
"\n tx: [{}]",
Hex.toHexString(receiver.getAddress()), Hex.toHexString(transaction.getHash()));
}
}
this.notifyListeners();
}