mirror of
https://github.com/Qortal/qortal.git
synced 2025-02-12 02:05:50 +00:00
fixed the query to get registered names
This commit is contained in:
parent
68a2e65fc7
commit
2b83c4bbf3
@ -1516,18 +1516,12 @@ public class HSQLDBAccountRepository implements AccountRepository {
|
|||||||
|
|
||||||
List<String> names = new ArrayList<>(count);
|
List<String> names = new ArrayList<>(count);
|
||||||
|
|
||||||
int nonRegisteredCount = 0;
|
|
||||||
|
|
||||||
do{
|
do{
|
||||||
String name = namesResultSet.getString(1);
|
String name = namesResultSet.getString(1);
|
||||||
|
|
||||||
if( name != null ) {
|
if( name != null ) {
|
||||||
names.add(name);
|
names.add(name);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
nonRegisteredCount++;
|
|
||||||
}
|
|
||||||
|
|
||||||
} while( namesResultSet.next() );
|
} while( namesResultSet.next() );
|
||||||
|
|
||||||
return names;
|
return names;
|
||||||
@ -1535,10 +1529,8 @@ public class HSQLDBAccountRepository implements AccountRepository {
|
|||||||
|
|
||||||
private ResultSet getNamesResultSet(List<String> sponseeAddresses, int sponseeCount) throws SQLException {
|
private ResultSet getNamesResultSet(List<String> sponseeAddresses, int sponseeCount) throws SQLException {
|
||||||
StringBuffer namesSql = new StringBuffer();
|
StringBuffer namesSql = new StringBuffer();
|
||||||
namesSql.append("SELECT r.name ");
|
namesSql.append("SELECT name FROM NAMES ");
|
||||||
namesSql.append("FROM ACCOUNTS a ");
|
namesSql.append("WHERE owner in (");
|
||||||
namesSql.append("LEFT JOIN REGISTERNAMETRANSACTIONS r on r.registrant = a.public_key ");
|
|
||||||
namesSql.append("WHERE account in (");
|
|
||||||
namesSql.append(String.join(", ", Collections.nCopies(sponseeCount, "?")));
|
namesSql.append(String.join(", ", Collections.nCopies(sponseeCount, "?")));
|
||||||
namesSql.append(")");
|
namesSql.append(")");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user