We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
问题代码文件: plugin/consensus/ticket/ticket.go 问题代码:
func (client *Client) delTicket(ticket *ty.Ticket, index int) { client.ticketmu.Lock() defer client.ticketmu.Unlock() //1. 结构体没有被重新调整过 oldticket := client.tlist.Tickets[index] // <--- 这里的index可能出现越界、过期index的情况 .... }
问题描述: client.delTicket(ticket, index)的index参数通过Miner下的client.searchTargetTicket(parent, block)操作获取。 操作对象为client.tlist.Tickets, 该对象在运行过程中存在多个协程共同操作的现象,会导致client.searchTargetTicket返回的Index已经被其他协程删除、或者被调整,可能会引起数据处理错误甚至程序崩溃。
The text was updated successfully, but these errors were encountered:
33cn#51
315ac0c
调整保存Ticket列表的容器结构,由slice修改为map,修复了随机访问时可能出现的崩溃问题,提高了搜索效率。
#51
5e8dbee
Successfully merging a pull request may close this issue.
问题代码文件: plugin/consensus/ticket/ticket.go
问题代码:
问题描述:
client.delTicket(ticket, index)的index参数通过Miner下的client.searchTargetTicket(parent, block)操作获取。
操作对象为client.tlist.Tickets, 该对象在运行过程中存在多个协程共同操作的现象,会导致client.searchTargetTicket返回的Index已经被其他协程删除、或者被调整,可能会引起数据处理错误甚至程序崩溃。
The text was updated successfully, but these errors were encountered: