1

When i call app.sdb.load('Account', senderId) with senderId set to a valid addres the result is (unexpected) an object which contains the account info, like that shown beneath:

{  
   "address":"AEc252iX7f75DzEYybe5EtfjwX8GEBsdxB",
   "name":null,
   "xas":100000000000,
   "publicKey":null,
   "secondPublicKey":null,
   "isLocked":0,
   "isAgent":0,
   "isDelegate":0,
   "role":0,
   "lockHeight":0,
   "agent":null,
   "weight":0,
   "agentWeight":0,
   "_version_":1
}

According the docs at https://github.com/AschPlatform/asch-docs/blob/master/sdk_api/en.md#11-aync-appsdbloadmodel-fields-indices:

The operation has no return value, it throws an Exception when an error occurs Load the data for the specified model into memory and index the table which can further improve the efficiency of the query When a data model needs frequent updates and inquiries, it is recommended to use this interface, such as the system's built-in account balance, the increment ID uses this operation

So did it change since version 1.4?

Nisarg
  • 1,631
  • 6
  • 19
  • 31
Bass Jobsen
  • 48,736
  • 16
  • 143
  • 224

1 Answers1

1

The function call to app.sdb.load('Account', senderId)can only find an address if an address entry was created in the Accounts blockchain database table.

An entry is created if XAS is send to this specific address. Because there can be hundreds of million of possible addresses, we don't want them from the beginning in the blockchain database. That only would bloat the database and had no practical use.

a1300
  • 2,633
  • 2
  • 14
  • 18