Skip to content

Commit

Permalink
core: prevent access to uninitialized NotaryAssisted fee
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Shaleva <[email protected]>
  • Loading branch information
AnnaShaleva committed Jul 15, 2024
1 parent 1c3644f commit 8871165
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2117,6 +2117,9 @@ func (bc *Blockchain) GetNotaryBalance(acc util.Uint160) *big.Int {
// per key which is a reward per notary request key for designated notary nodes.
// Default value is returned if Notary contract is not yet active.
func (bc *Blockchain) GetNotaryServiceFeePerKey() int64 {
if !bc.isHardforkEnabled(&transaction.NotaryAssistedActivation, bc.BlockHeight()) {
return 0

Check warning on line 2121 in pkg/core/blockchain.go

View check run for this annotation

Codecov / codecov/patch

pkg/core/blockchain.go#L2121

Added line #L2121 was not covered by tests
}
return bc.contracts.Policy.GetAttributeFeeInternal(bc.dao, transaction.NotaryAssistedT)
}

Expand Down

0 comments on commit 8871165

Please sign in to comment.