Improve API output of GET /blocks/forgers

This commit is contained in:
catbref 2019-06-04 16:15:18 +01:00
parent 97a5b3ef9b
commit 3a3cc5a81b

View File

@ -15,6 +15,7 @@ public class BlockForgerSummary {
public String forgedBy;
public String forgedFor;
public byte[] proxyPublicKey;
// Constructors
@ -22,10 +23,12 @@ public class BlockForgerSummary {
}
public BlockForgerSummary(byte[] generator, int blockCount, byte[] forger, String recipient) {
this.generatorAddress = Crypto.toAddress(generator);
this.blockCount = blockCount;
if (recipient != null) {
if (recipient == null) {
this.generatorAddress = Crypto.toAddress(generator);
} else {
this.proxyPublicKey = generator;
this.forgedBy = Crypto.toAddress(forger);
this.forgedFor = recipient;
}