-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
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
Update txs synchronization and tx pool #20
Conversation
sender, err := types.Sender(tx) | ||
// TODO: @lew | ||
// Double check to ensure the signer | ||
sender, err := types.Sender(types.HomesteadSigner{}, tx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why HomesteadSigner? If it's that old, we should just use our own Signer
} | ||
n := rand.Intn(len(pending)) + 1 | ||
for _, s := range pending { | ||
if n--; n == 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shoud it just be "if n-- ==0" ?
|
||
// If we're reorging an old state, reinject all dropped transactions | ||
// var reinject types.Transactions | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should add comment why you comment this out
This PR maybe resolve #15
First it will mark the txs pool and pop txs if they're oversize the pool
https://github.com/kardiachain/go-kardiamain/blob/update/tx_pool/kai/service/peer.go#L321
The txs will sync in a channel and disconnect from p2p if there is no more pending txs
https://github.com/kardiachain/go-kardiamain/blob/update/tx_pool/kai/service/protocol_manager.go#L87
It's also break the txs to chunks and send async them over the network #13
https://github.com/kardiachain/go-kardiamain/blob/update/tx_pool/kai/service/peer.go#L401