Showing 1,051 of 1,052 total issues
Method AergoRPCService.GetNameInfo
has 5 return statements (exceeds 4 allowed). Open
Open
func (rpc *AergoRPCService) GetNameInfo(ctx context.Context, in *types.Name) (*types.NameInfo, error) {
if err := rpc.checkAuth(ctx, ReadBlockChain); err != nil {
return nil, err
}
result, err := rpc.hub.RequestFuture(message.ChainSvc,
Method baseWireHandshaker.readWireHSResp
has 5 return statements (exceeds 4 allowed). Open
Open
func (h *baseWireHandshaker) readWireHSResp(rd io.Reader) (header p2pcommon.HSHeadResp, err error) {
bytebuf := make([]byte, p2pcommon.HSMagicLength)
readn, err := p2putil.ReadToLen(rd, bytebuf[:p2pcommon.HSMagicLength])
if err != nil {
return
Method listManagerImpl.IsBanned
has 5 return statements (exceeds 4 allowed). Open
Open
func (lm *listManagerImpl) IsBanned(addr string, pid types.PeerID) (bool, time.Time) {
// empty entry is
if len(lm.entries) == 0 {
return false, FarawayFuture
}
Method BlockFactory.MakeConfChangeProposal
has 5 return statements (exceeds 4 allowed). Open
Open
func (bf *BlockFactory) MakeConfChangeProposal(req *types.MembershipChange) (*consensus.ConfChangePropose, error) {
var (
proposal *consensus.ConfChangePropose
err error
)
Method AergoRPCService.CreateAccount
has 5 return statements (exceeds 4 allowed). Open
Open
func (rpc *AergoRPCService) CreateAccount(ctx context.Context, in *types.Personal) (*types.Account, error) {
if err := rpc.checkAuth(ctx, WriteBlockChain); err != nil {
return nil, err
}
result, err := rpc.hub.RequestFutureResult(message.AccountsSvc,
Method AergoRPCService.VerifyTX
has 5 return statements (exceeds 4 allowed). Open
Open
func (rpc *AergoRPCService) VerifyTX(ctx context.Context, in *types.Tx) (*types.VerifyResult, error) {
if err := rpc.checkAuth(ctx, ReadBlockChain); err != nil {
return nil, err
}
//TODO : verify without account service
Method DPOSRoleManager.loadBPVotes
has 5 return statements (exceeds 4 allowed). Open
Open
func (rm *DPOSRoleManager) loadBPVotes() (map[types.PeerID]voteRank, []types.PeerID, error) {
bpCount := len(rm.is.ConsensusAccessor().ConsensusInfo().Bps)
unionCap := bpCount * 2
result, err := rm.actor.CallRequest(message.ChainSvc,
&message.GetElected{Id: types.OpvoteBP.ID(), N: uint32(bpCount * 2)}, getVotesMessageTimeout)
Method v1Strategy.Encrypt
has 5 return statements (exceeds 4 allowed). Open
Open
func (ks *v1Strategy) Encrypt(key *PrivateKey, passphrase string) ([]byte, error) {
// derive key
salt, err := newSalt()
if nil != err {
return nil, err
Method V200Handshaker.checkAgent
has 5 return statements (exceeds 4 allowed). Open
Open
func (h *V200Handshaker) checkAgent(status *types.Status) error {
h.logger.Debug().Int("certCnt", len(status.Certificates)).Stringer(p2putil.LogPeerID, types.LogPeerShort(h.remoteMeta.ID)).Msg("checking peer as agent")
// Agent must have at least one block producer
if len(h.remoteMeta.ProducerIDs) == 0 {
Method AergoRPCService.GetTX
has 5 return statements (exceeds 4 allowed). Open
Open
func (rpc *AergoRPCService) GetTX(ctx context.Context, in *types.SingleBytes) (*types.Tx, error) {
if err := rpc.checkAuth(ctx, ReadBlockChain); err != nil {
return nil, err
}
result, err := rpc.actorHelper.CallRequestDefaultTimeout(message.MemPoolSvc,
Method AergoRPCService.GetEnterpriseConfig
has 5 return statements (exceeds 4 allowed). Open
Open
func (rpc *AergoRPCService) GetEnterpriseConfig(ctx context.Context, in *types.EnterpriseConfigKey) (*types.EnterpriseConfig, error) {
genesis := rpc.actorHelper.GetChainAccessor().GetGenesisInfo()
if genesis.PublicNet() {
return nil, status.Error(codes.Unavailable, "not supported in public")
}
Function getStateDB
has 5 return statements (exceeds 4 allowed). Open
Open
func getStateDB(cfg *config.Config, cdb consensus.ChainDB, sdb *state.ChainStateDB) (*statedb.StateDB, error) {
if cfg.Blockchain.VerifyOnly {
vprInitBlockNo := func(blockNo types.BlockNo) types.BlockNo {
if blockNo == 0 {
return blockNo
Method AergoRPCService.LockAccount
has 5 return statements (exceeds 4 allowed). Open
Open
func (rpc *AergoRPCService) LockAccount(ctx context.Context, in *types.Personal) (*types.Account, error) {
if err := rpc.checkAuth(ctx, WriteBlockChain); err != nil {
return nil, err
}
result, err := rpc.hub.RequestFutureResult(message.AccountsSvc,
Method MemPool.put
has 5 return statements (exceeds 4 allowed). Open
Open
func (mp *MemPool) put(tx types.Transaction) error {
id := types.ToTxID(tx.GetHash())
acc := tx.GetBody().GetAccount()
if tx.HasVerifedAccount() {
acc = tx.GetVerifedAccount()
Method raftServer.triggerSnapshot
has 5 return statements (exceeds 4 allowed). Open
Open
func (rs *raftServer) triggerSnapshot() {
ce := rs.commitProgress.GetConnect()
newSnapshotIndex, snapBlock := ce.index, ce.block
if newSnapshotIndex == 0 || rs.confState == nil {
Method raftServer.publishEntries
has 5 return statements (exceeds 4 allowed). Open
Open
func (rs *raftServer) publishEntries(ents []raftpb.Entry) bool {
var lastBlockEnt *raftpb.Entry
isDuplicateCommit := func(block *types.Block) bool {
lastReq := rs.commitProgress.GetRequest()
Function decrypt
has 5 return statements (exceeds 4 allowed). Open
Open
func decrypt(base, key, data []byte) ([]byte, error) {
if len(base) < 16 {
return nil, errors.New("too short address length")
}
nonce := base[4:16]
Method MemPool.getNameDest
has 5 return statements (exceeds 4 allowed). Open
Open
func (mp *MemPool) getNameDest(account []byte, owner bool) []byte {
if mp.testConfig {
return account
}
Method AergoRPCService.GetAccounts
has 5 return statements (exceeds 4 allowed). Open
Open
func (rpc *AergoRPCService) GetAccounts(ctx context.Context, in *types.Empty) (*types.AccountList, error) {
if err := rpc.checkAuth(ctx, ShowNode); err != nil {
return nil, err
}
result, err := rpc.hub.RequestFutureResult(message.AccountsSvc,
Function readWireHSResp
has 5 return statements (exceeds 4 allowed). Open
Open
func readWireHSResp(rd io.Reader) (resp types.SnapshotResponse, err error) {
bytebuf := make([]byte, SnapRespHeaderLength)
readn, err := p2putil.ReadToLen(rd, bytebuf)
if err != nil {
return