aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/configuration-chain.go8
-rw-r--r--core/consensus.go1
2 files changed, 8 insertions, 1 deletions
diff --git a/core/configuration-chain.go b/core/configuration-chain.go
index 559eac0..bf24c31 100644
--- a/core/configuration-chain.go
+++ b/core/configuration-chain.go
@@ -205,6 +205,12 @@ func (cc *configurationChain) touchTSigHash(hash common.Hash) (first bool) {
return !exist
}
+func (cc *configurationChain) untouchTSigHash(hash common.Hash) {
+ cc.tsigReady.L.Lock()
+ defer cc.tsigReady.L.Unlock()
+ delete(cc.tsigTouched, hash)
+}
+
func (cc *configurationChain) runTSig(
round uint64, hash common.Hash) (
crypto.Signature, error) {
@@ -240,10 +246,10 @@ func (cc *configurationChain) runTSig(
signature, err = cc.tsig[hash].signature()
return err == ErrNotEnoughtPartialSignatures
}() {
+ // TODO(jimmy-dexon): add a timeout here.
cc.tsigReady.Wait()
}
delete(cc.tsig, hash)
- delete(cc.tsigTouched, hash)
if err != nil {
return crypto.Signature{}, err
}
diff --git a/core/consensus.go b/core/consensus.go
index 5ad37a9..938337f 100644
--- a/core/consensus.go
+++ b/core/consensus.go
@@ -935,6 +935,7 @@ func (con *Consensus) processBlock(block *types.Block) (err error) {
if err = con.db.Update(*b); err != nil {
panic(err)
}
+ con.cfgModule.untouchTSigHash(b.Hash)
// TODO(mission): clone types.FinalizationResult
con.app.BlockDelivered(b.Hash, b.Finalization)
}