Skip to content

Commit 0dda417

Browse files
authored
blockchain: if passed header only validate header (#1105)
1 parent 93ae8f5 commit 0dda417

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/blockchain/src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,11 @@ export default class Blockchain implements BlockchainInterface {
823823

824824
if (this._validateBlocks && !isGenesis) {
825825
// this calls into `getBlock`, which is why we cannot lock yet
826-
await block.validate(this)
826+
if (item instanceof BlockHeader) {
827+
await block.header.validate(this)
828+
} else {
829+
await block.validate(this)
830+
}
827831
}
828832

829833
if (this._validateConsensus) {

0 commit comments

Comments
 (0)