Skip to content

Commit

Permalink
Is the message resolved?
Browse files Browse the repository at this point in the history
  • Loading branch information
gagliardetto committed May 28, 2024
1 parent 7c6835c commit db77a44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions message.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,10 @@ func (mx *Message) ResolveLookups() (err error) {
return nil
}

func (mx Message) IsResolved() bool {
return mx.resolved
}

// GetAllKeys returns ALL the message's account keys (including the keys from resolved address lookup tables).
func (mx Message) GetAllKeys() (keys PublicKeySlice, err error) {
if mx.resolved {
Expand Down
3 changes: 3 additions & 0 deletions transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -789,6 +789,9 @@ func countWriteableAccounts(tx *Transaction) (count int) {
count++
}
}
if tx.Message.IsResolved() {
return count
}
count += tx.Message.NumWritableLookups()
return count
}
Expand Down

0 comments on commit db77a44

Please sign in to comment.