Validate votebits in payfee (#37)

This commit is contained in:
Jamie Holdstock 2020-05-20 08:09:18 +01:00 committed by GitHub
parent cf55092c21
commit 00525f4d53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -261,6 +261,11 @@ func payFee(c *gin.Context) {
}
voteBits := payFeeRequest.VoteBits
if !isValidVoteBits(cfg.NetParams, currentVoteVersion(cfg.NetParams), voteBits) {
log.Warnf("Invalid votebits from %s", c.ClientIP())
sendErrorResponse("invalid votebits", http.StatusBadRequest, c)
return
}
feeTxBytes, err := hex.DecodeString(payFeeRequest.FeeTx)
if err != nil {