diff options
author | Stephen Akiki <stephen.akiki@algorand.com> | 2022-05-12 11:29:38 -0400 |
---|---|---|
committer | Stephen Akiki <stephen.akiki@algorand.com> | 2022-05-12 12:53:33 -0400 |
commit | c78bb0c59064d79577ddbd2530a7a4a9b7da2991 (patch) | |
tree | 6a94f646126faa2742f038dce1c25a0176ded649 | |
parent | ad45c7e58d6eb0d7d2383c361b1aaa5d473c351d (diff) |
Check that state proofs aren't empty3924-handle-stateproof-in-rest-api-goal
-rw-r--r-- | node/node.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/node/node.go b/node/node.go index c2a379de1..366144c72 100644 --- a/node/node.go +++ b/node/node.go @@ -404,7 +404,7 @@ func (node *AlgorandFullNode) Start() { // startMonitoringRoutines starts the internal monitoring routines used by the node. func (node *AlgorandFullNode) startMonitoringRoutines() { node.monitoringRoutinesWaitGroup.Add(2) - go node.txPoolGaugeThread() + go node.txPoolGaugeThread(node.ctx.Done()) // Delete old participation keys go node.oldKeyDeletionThread(node.ctx.Done()) @@ -899,6 +899,16 @@ func (node *AlgorandFullNode) InstallParticipationKey(partKeyBinary []byte) (acc } defer partkey.Close() + // We want to make sure that the state proof keys are included in the participation key + + if partkey.StateProofSecrets == nil { + return account.ParticipationID{}, fmt.Errorf("cannot install partkey with missing state proof keys") + } + + if len(partkey.StateProofSecrets.GetAllKeys()) == 0 { + return account.ParticipationID{}, fmt.Errorf("cannot install partkey with missing state proof keys") + } + if partkey.Parent == (basics.Address{}) { return account.ParticipationID{}, fmt.Errorf("cannot install partkey with missing (zero) parent address") } |