for p.knownSignatures.Size() >= maxKnownSignatures {
p.knownSignatures.Pop()
}
- p.knownSignatures.Add(signature)
+ p.knownSignatures.Add(hex.EncodeToString(signature))
}
func (p *Peer) markTransaction(hash *bc.Hash) {
var peers []string
for _, peer := range ps.peers {
- if !peer.knownSignatures.Has(signature) {
+ if !peer.knownSignatures.Has(hex.EncodeToString(signature)) {
peers = append(peers, peer.ID())
}
}
import (
"encoding/binary"
+ "encoding/hex"
"encoding/json"
"fmt"
"net"
"time"
log "github.com/sirupsen/logrus"
- "github.com/tendermint/go-crypto"
+ crypto "github.com/tendermint/go-crypto"
cmn "github.com/tendermint/tmlibs/common"
cfg "github.com/vapor/config"
blacklistDB := dbm.NewDB("trusthistory", config.DBBackend, config.DBDir())
- bytes := config.PrivateKey()[:]
+ _, yyy, _ := ed25519.GenerateKey(nil)
+ zzz := yyy.String()
+
+ bytes, err := hex.DecodeString(zzz)
+ if err != nil {
+ return nil, err
+ }
var newKey [64]byte
copy(newKey[:], bytes)
privKey := crypto.PrivKeyEd25519(newKey)