-
Notifications
You must be signed in to change notification settings - Fork 293
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
multi: add specialized rebroadcast handling for stake txs. #979
Conversation
server.go
Outdated
@@ -179,6 +180,8 @@ type server struct { | |||
txIndex *indexers.TxIndex | |||
addrIndex *indexers.AddrIndex | |||
existsAddrIndex *indexers.ExistsAddrIndex | |||
|
|||
pendingInvs map[wire.InvVect]interface{} |
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.
Please don't move this out of the rebroadcast handler. It's no longer concurrent safe moving it out here. You've introduced races by doing this.
blockmanager.go
Outdated
@@ -2077,6 +2077,13 @@ func (b *blockManager) handleNotifyMsg(notification *blockchain.Notification) { | |||
} | |||
|
|||
for _, stx := range block.STransactions()[0:] { | |||
// Remove rebroadcast inventory for revocations | |||
if txType := stake.DetermineTxType(stx.MsgTx()); txType == stake.TxTypeSSRtx { |
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.
This section is incorrect in at least 2 ways:
- A block being connected does not invalidate a revocation. It's only invalidated if it was a revocation for a ticket which was previously invalid, but is now valid again
- It's skipping the required mempool updates below due to the continue
blockmanager.go
Outdated
@@ -2173,6 +2180,13 @@ func (b *blockManager) handleNotifyMsg(notification *blockchain.Notification) { | |||
} | |||
|
|||
for _, tx := range block.STransactions()[0:] { | |||
// Remove rebroadcast inventory for revocations | |||
if txType := stake.DetermineTxType(tx.MsgTx()); txType == stake.TxTypeSSRtx { |
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.
Same here regarding this being incorrect. A block being disconnected does not necessarily invalidate a revocation.
fe5b50a
to
6f2713d
Compare
6f2713d
to
0790e6d
Compare
2ca40aa
to
df39b0a
Compare
df39b0a
to
2f27301
Compare
resolves #975