Skip to content

Commit

Permalink
Host: Drop transactions received when enclave not ready (#1762) (#1766)
Browse files Browse the repository at this point in the history
  • Loading branch information
BedrockSquirrel authored Jan 29, 2024
1 parent 3957249 commit 155f080
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions go/host/enclave/guardian.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ func (g *Guardian) HandleBatch(batch *common.ExtBatch) {
}

func (g *Guardian) HandleTransaction(tx common.EncryptedTx) {
if g.GetEnclaveState().status == Disconnected ||
g.GetEnclaveState().status == Unavailable ||
g.GetEnclaveState().status == AwaitingSecret {
g.logger.Info("Enclave is not ready yet, dropping transaction.")
return // ignore transactions when enclave unavailable
}
resp, sysError := g.enclaveClient.SubmitTx(tx)
if sysError != nil {
g.logger.Warn("could not submit transaction due to sysError", log.ErrKey, sysError)
Expand Down

0 comments on commit 155f080

Please sign in to comment.