File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
src/main/java/org/tron/core Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,9 @@ public static boolean dbExists() {
195
195
196
196
197
197
/**
198
- * add a block
198
+ * add a block into database
199
+ *
200
+ * @param block
199
201
*/
200
202
public void addBlock (Block block ) {
201
203
byte [] blockInDB = blockDB .getData (block .getBlockHeader ().getHash ().toByteArray ());
@@ -259,7 +261,10 @@ public void addBlock(List<Transaction> transactions, Net net) {
259
261
}
260
262
261
263
/**
262
- * receive block and save it into database
264
+ * receive a block and save it into database,update caching at the same time.
265
+ *
266
+ * @param block block
267
+ * @param utxoSet utxoSet
263
268
*/
264
269
public void receiveBlock (Block block , UTXOSet utxoSet ) {
265
270
@@ -271,7 +276,7 @@ public void receiveBlock(Block block, UTXOSet utxoSet) {
271
276
return ;
272
277
}
273
278
274
- // save the block ginto the database
279
+ // save the block into the database
275
280
byte [] blockHashKey = block .getBlockHeader ().getHash ().toByteArray ();
276
281
byte [] blockVal = block .toByteArray ();
277
282
blockDB .putData (blockHashKey , blockVal );
You can’t perform that action at this time.
0 commit comments