Skip to content

Commit bc289ef

Browse files
fix
1 parent 831461f commit bc289ef

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/main/java/org/tron/core/Blockchain.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ public static boolean dbExists() {
195195

196196

197197
/**
198-
* add a block
198+
* add a block into database
199+
*
200+
* @param block
199201
*/
200202
public void addBlock(Block block) {
201203
byte[] blockInDB = blockDB.getData(block.getBlockHeader().getHash().toByteArray());
@@ -259,7 +261,10 @@ public void addBlock(List<Transaction> transactions, Net net) {
259261
}
260262

261263
/**
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
263268
*/
264269
public void receiveBlock(Block block, UTXOSet utxoSet) {
265270

@@ -271,7 +276,7 @@ public void receiveBlock(Block block, UTXOSet utxoSet) {
271276
return;
272277
}
273278

274-
// save the block ginto the database
279+
// save the block into the database
275280
byte[] blockHashKey = block.getBlockHeader().getHash().toByteArray();
276281
byte[] blockVal = block.toByteArray();
277282
blockDB.putData(blockHashKey, blockVal);

0 commit comments

Comments
 (0)