mirror of
https://github.com/Qortal/qortal.git
synced 2025-04-01 17:55:54 +00:00
Added minter address to block summary API results
This commit is contained in:
parent
8bd293ccd5
commit
e4c4507f6b
@ -1,7 +1,13 @@
|
|||||||
package org.qortal.data.block;
|
package org.qortal.data.block;
|
||||||
|
|
||||||
|
import org.qortal.account.Account;
|
||||||
|
import org.qortal.repository.DataException;
|
||||||
|
import org.qortal.repository.Repository;
|
||||||
|
import org.qortal.repository.RepositoryManager;
|
||||||
|
|
||||||
import javax.xml.bind.annotation.XmlAccessType;
|
import javax.xml.bind.annotation.XmlAccessType;
|
||||||
import javax.xml.bind.annotation.XmlAccessorType;
|
import javax.xml.bind.annotation.XmlAccessorType;
|
||||||
|
import javax.xml.bind.annotation.XmlElement;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
@XmlAccessorType(XmlAccessType.FIELD)
|
@XmlAccessorType(XmlAccessType.FIELD)
|
||||||
@ -103,6 +109,23 @@ public class BlockSummaryData {
|
|||||||
this.minterLevel = minterLevel;
|
this.minterLevel = minterLevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "minterAddress")
|
||||||
|
public String getMinterAddress() {
|
||||||
|
if (this.minterPublicKey == null) {
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
try (final Repository repository = RepositoryManager.getRepository()) {
|
||||||
|
return Account.getRewardShareMintingAddress(repository, this.minterPublicKey);
|
||||||
|
} catch (DataException e) {
|
||||||
|
// Log the exception as needed
|
||||||
|
return "Unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@XmlElement(name = "minterLevel")
|
||||||
|
public Integer getMinterLevelXml() {
|
||||||
|
return this.getMinterLevel();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object o) {
|
public boolean equals(Object o) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user