Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Commit f65519a

Browse files
committed
check if there is a last block stored
1 parent fd06c2d commit f65519a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/delegates.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ __private.forge = function (cb) {
254254
var currentSlot = slots.getSlotNumber();
255255
// If we are supposed to forge now, be sure we got the very last block
256256
var lastBlock = modules.blockchain.getLastBlock();
257-
if (currentSlot === slots.getSlotNumber(lastBlock.timestamp)) {
257+
if (!lastBlock || currentSlot === slots.getSlotNumber(lastBlock.timestamp)) {
258258
err = 'Last block within same delegate slot';
259259
return setImmediate(cb, err);
260260
}

0 commit comments

Comments
 (0)