cachekey := signCacheKey(blockHash.String(), pubKey)
if signature, ok := c.signatureCache.Get(cachekey); ok {
block.Set(node.Order, signature.([]byte))
- c.eventDispatcher.Post(event.BlockSignatureEvent{BlockHash: blockHash, Signature: signature.([]byte), XPub: []byte(pubKey)})
+ c.eventDispatcher.Post(event.BlockSignatureEvent{BlockHash: blockHash, Signature: signature.([]byte), XPub: node.XPub[:]})
c.signatureCache.Remove(cachekey)
} else {
continue
// save the signature if the block is not exist
if blockHeader == nil {
var xPubKey chainkd.XPub
- copy(xPub[:], xPub[:])
+ copy(xPubKey[:], xPub[:])
if !xPubKey.Verify(blockHash.Bytes(), signature) {
return errInvalidSignature
}