OSDN Git Service
(root)
/
bytom
/
vapor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0f90b9d
)
add broadcast block signature (#139)
author
muscle_boy
<shenao.78@163.com>
Thu, 6 Jun 2019 02:10:11 +0000
(10:10 +0800)
committer
Paladz
<yzhu101@uottawa.ca>
Thu, 6 Jun 2019 02:10:11 +0000
(10:10 +0800)
protocol/bbft.go
patch
|
blob
|
history
diff --git
a/protocol/bbft.go
b/protocol/bbft.go
index
40b2730
..
4fdb607
100644
(file)
--- a/
protocol/bbft.go
+++ b/
protocol/bbft.go
@@
-11,6
+11,7
@@
import (
"github.com/vapor/protocol/bc"
"github.com/vapor/protocol/bc/types"
"github.com/vapor/protocol/state"
"github.com/vapor/protocol/bc"
"github.com/vapor/protocol/bc/types"
"github.com/vapor/protocol/state"
+ "github.com/vapor/event"
)
const (
)
const (
@@
-65,7
+66,11
@@
func (c *Chain) ProcessBlockSignature(signature []byte, xPub [64]byte, blockHash
return err
}
return err
}
- if consensusNode.XPub.Verify(blockHash.Bytes(), signature) {
+ if exist, err := blockNode.BlockWitness.Test(uint32(consensusNode.Order)); err != nil && exist {
+ return nil
+ }
+
+ if !consensusNode.XPub.Verify(blockHash.Bytes(), signature) {
return errInvalidSignature
}
return errInvalidSignature
}
@@
-90,7
+95,8
@@
func (c *Chain) ProcessBlockSignature(signature []byte, xPub [64]byte, blockHash
c.bestIrreversibleNode = bestIrreversibleNode
}
c.bestIrreversibleNode = bestIrreversibleNode
}
- return nil
+
+ return c.eventDispatcher.Post(event.BlockSignatureEvent{BlockHash: *blockHash, Signature: signature, XPub: xPub})
}
// validateSign verify the signatures of block, and return the number of correct signature
}
// validateSign verify the signatures of block, and return the number of correct signature