Skip to content

Commit ed745a9

Browse files
TMKCodesToni Lukkaroinenmichaelsuttonsomeone235
authored
Fix block verbosedata population… (kaspanet#2275)
* Fix block verbosedata population from skipping transaction verbosedata population when BlockInfo errorenously reports block as Header only, but domainBlock is still fount with GetBlockEvenIfHeaderOnly. * Update app/rpc/rpccontext/verbosedata.go --------- Co-authored-by: Toni Lukkaroinen <[email protected]> Co-authored-by: Michael Sutton <[email protected]> Co-authored-by: Ori Newman <[email protected]>
1 parent c23c1d1 commit ed745a9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/rpc/rpccontext/verbosedata.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ func (ctx *Context) PopulateBlockWithVerboseData(block *appmessage.RPCBlock, dom
8181
block.VerboseData.SelectedParentHash = blockInfo.SelectedParent.String()
8282
}
8383

84-
if blockInfo.BlockStatus == externalapi.StatusHeaderOnly {
85-
return nil
86-
}
87-
8884
// Get the block if we didn't receive it previously
8985
if domainBlock == nil {
9086
domainBlock, err = ctx.Domain.Consensus().GetBlockEvenIfHeaderOnly(blockHash)
@@ -93,6 +89,10 @@ func (ctx *Context) PopulateBlockWithVerboseData(block *appmessage.RPCBlock, dom
9389
}
9490
}
9591

92+
if len(domainBlock.Transactions) == 0 {
93+
return nil
94+
}
95+
9696
transactionIDs := make([]string, len(domainBlock.Transactions))
9797
for i, transaction := range domainBlock.Transactions {
9898
transactionIDs[i] = consensushashing.TransactionID(transaction).String()

0 commit comments

Comments
 (0)