Skip to content

Commit 703f2a0

Browse files
check nil transactions (#1537)
1 parent ab9f7fe commit 703f2a0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

core/types/transaction.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,9 @@ func (m Message) WithEmptyPrivateData(b bool) Message {
647647
}
648648

649649
func (tx *Transaction) IsPrivate() bool {
650+
if tx == nil {
651+
return false
652+
}
650653
v, _, _ := tx.RawSignatureValues()
651654
if v == nil {
652655
return false
@@ -675,7 +678,7 @@ func (tx *Transaction) SetPrivate() {
675678
}
676679

677680
func (tx *Transaction) IsPrivacyMarker() bool {
678-
return tx.To() != nil && *tx.To() == common.QuorumPrivacyPrecompileContractAddress()
681+
return tx != nil && tx.To() != nil && *tx.To() == common.QuorumPrivacyPrecompileContractAddress()
679682
}
680683

681684
// PrivacyMetadata encapsulates privacy information to be attached

0 commit comments

Comments
 (0)