1

当我调用app.sdb.load('Account', senderId)设置senderId为有效地址时,结果是(意外)一个包含帐户信息的对象,如下所示:

{  
   "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
}

根据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

那么自 1.4 版以来它是否发生了变化?

4

1 回答 1

1

如果在区块链数据库表中创建了地址条目,则函数调用app.sdb.load('Account', senderId)只能找到地址。Accounts

如果将 XAS 发送到此特定地址,则会创建一个条目。因为可能有数亿个可能的地址,我们不希望它们从一开始就在区块链数据库中。这只会使数据库膨胀,没有实际用途。

于 2018-08-14T23:08:13.407 回答