 beaconpublickey.GetNormalKey())
		if err!= nil {
			Logger.log.Errorf("BuildInstForBeaconReward error %+v\n Totalreward: %+v, epoch: %+v, reward: %+v\n", err, totalReward, epoch, baseRewards)
			return nil, err
		}
		resInst = append(resInst, singleInst)
	}
	return resInst, nil
}

func (blockchain *BlockChain) buildInstRewardForIncDAO(epoch uint64, totalReward map[common.Hash]uint64) ([][]string, error) {
	resInst := [][]string{}
	devRewardInst, err := metadata.BuildInstForIncDAOReward(totalReward, config.Param().IncognitoDAOAddress)
	if err!= nil {
		Logger.log.Errorf("buildInstRewardForIncDAO error %+v\n Totalreward: %+v, epoch: %+v\n", err, totalReward, epoch)
		return nil, err
	}
	resInst = append(resInst, devRewardInst)
	return resInst, nil
}

func (blockchain *BlockChain) buildInstructionRewardForShardsV3(epoch uint64, totalRewards [][]map[common.Hash]uint64) ([][]string, error) {
	resInst := [][]string{}

	for shardID, v := range totalRewards {
		for subsetID, reward := range v {
			if len(reward) > 0 {
				shardSubsetReward := instruction.NewShardReceiveRewardV3WithValue(reward, epoch, byte(shardID), byte(subsetID))
				shardSubsetRewardInst := shardSubsetReward.String()
				resInst = append(resInst, shardSubsetRewardInst)
			}
		}
	}

	return resInst, nil
}

func (blockchain *BlockChain) buildInstructionRewardForShards(epoch uint64, totalRewards []map[common.Hash]uint64) ([][]string, error) {
	resInst := [][]string{}
	for i, reward := range totalRewards {
		if len(reward) > 0 {
			shardRewardInst, err := instruction.NewShardReceiveRewardV1WithValue(reward, epoch, byte(i))
			if err!= nil {
				Logger.log.Errorf("BuildInstForShardReward error %+v\n Totalreward: %+v, epoch: %+v\n; shard:%+v", err, reward, epoch, byte(i))
				return nil, err
			}
			resInst = append(resInst, shardRewardInst...)
		}
	}
	return resInst, nil
}

func (blockchain *BlockChain) buildWithDrawTransactionResponse(view *ShardBestState, txRequest *metadata.Transaction, blkProducerPrivateKey *privacy.PrivateKey, shardID byte) (metadata.Transaction, error) {
	if (*txRequest).GetMetadataType()!= metadata.WithDrawRewardRequestMeta {
		return nil, errors.New("Can not understand this request!")
	}
	requestDetail := (*txRequest).GetMetadata().(*metadata.WithDrawRewardRequest)
	tempPublicKey := base58.Base58Check{}.Encode(requestDetail.PaymentAddress.Pk, common.Base58Version)
	amount, err := statedb.GetCommitteeReward(view.GetShardRewardStateDB(), tempPublicKey, requestDetail.TokenID)
	if (amount == 0) || (err!= nil) {
		return nil, errors.New("Not enough reward")
	}
	responseMeta, err := metadata.NewWithDrawRewardResponse(requestDetail, (*txRequest).Hash())
	if err!= nil {
		return nil, err
	}
	txParam := transaction.TxSalaryOutputParams{Amount: amount, ReceiverAddress: &requestDetail.PaymentAddress, TokenID: &requestDetail.TokenID}
	makeMD := func(c privacy.Coin) metadata.Metadata {
		if c!= nil && c.GetSharedRandom()!= nil {
			responseMeta.SetSharedRandom(c.GetSharedRandom().ToBytesS())
		}
		return responseMeta
	}

	salaryTx, err := txParam.BuildTxSalary(blkProducerPrivateKey, view.GetCopiedTransactionStateDB(), makeMD)
	if err!= nil {
		return nil, errors.Errorf("cannot init salary tx. Error %v", err)
	}
	salaryTx.SetType(common.TxRewardType)
	return salaryTx, nil
}

func (blockchain *BlockChain) getRewardAmount(blkHeight uint64) uint64 {
	blockBeaconInterval := config.Param().BlockTime.MinBeaconBlockInterval.Seconds()
	blockInYear := getNoBlkPerYear(uint64(blockBeaconInterval))
	n := (blkHeight - 1) / blockInYear
	reward := uint64(config.Param().BasicReward)
	for ; n > 0; n-- {
		reward *= 91
		reward /= 100
	}
	return reward
}

func getNoBlkPerYear(blockCreationTimeSeconds uint64) uint64 {
	return (365.25 * 24 * 60 * 60) / blockCreationTimeSeconds
}

func getPercentForIncognitoDAO(blockHeight, blkPerYear uint64) int {
	year := (blockHeight - 1) / blkPerYear
	if year > (UpperBoundPercentForIncDAO - LowerBoundPercentForIncDAO) {
		return LowerBoundPercentForIncDAO
	} else {
		return UpperBoundPercentForIncDAO - int(year)
	}
}

// plusMap(src, dst): dst = dst + src
func plusMap(src, dst map[common.Hash]uint64) {
	if src!= nil {
		for key, value := range src {
			dst[key] += value
		}
	}
}
Well what a night we had at the Kent Charity Awards. Meeting lovely people and amazing charities. Well done to Porchlight who won the category and to the Kenward Trust who were overall winners.Limited 5G rollout kicks off later this year says mobile operator, with more to follow when 5G smartphones arrive in larger quantities.
O2 is starting its 5G rollout in Belfast, Cardiff, Edinburgh and London later this year. The mobile operator said it will bring 5G to other areas of the UK "from 2020", which will coincide with the wider availability of 5G handsets.
The mobile operator said it will also make 5G test environments accessible to business alongside this, including at its Wayra accelerator hubs. Last year O2 put a call out to big businesses in the UK across the construction, retail, transport and utility sectors to help find 5G use cases, and said that as a result of the demand for these initial trials with large firms it is now extending the testbeds so smaller companies can test out 5G.
O2 said it is also working on a range of 5G trials across the country, including the AutoAir project at Millbrook Proving Ground to test automotive use cases with new British equipment vendors, as well as wider industrial applications as part of the Worcestershire 5G Consortium. In April 2018, O2 bought £523.6m-worth of new mobile airwaves at Ofcom's spectrum auction, including 40MHz of 3.4GHz spectrum to be used for 5G.
O2 also has a 5G test network at The O2 venue in London to test the robustness of the technology for a wide range of consumer and business applications ahead of launch. The network is made up of an independent core network serving five locations inside the venue, using the 3.4GHz spectrum.
5G holds the promise of much more bandwidth for consumers and a network that responds much faster, making applications like virtual reality and real-time video much more usable. 5G can also support many more devices, which could lead to massive growth in the Internet of Things. However, few 5G networks are likely to be up and running at any scale before the end of the year and 5G handsets aren't likely to be widely available until around the same time.
Late last year, EE said it will be launching 5G within 16 UK cities in 2019, and switching on 5G in the busiest locations across London, Cardiff, Edinburgh, Belfast, Birmingham and Manchester as phase one of its launch, followed by parts of Glasgow, Newcastle, Liverpool, Leeds, Hull, Sheffield, Nottingham, Leicester, Coventry and Bristol. Vodafone and Three have also said they will deliver 5G in 2019.
Discover the simple pleasure of tasty food and warm hospitality in timeless surroundings.
This inspiring brasserie is situated along Zeedijk in