-
Notifications
You must be signed in to change notification settings - Fork 7
Conversation
// Priority txs are gossiped using peer pointer priority txs so we to do not include | ||
// them here to avoid sending duplicates | ||
if _, ok := memTx.senders.Load(peerID); !ok && !isPriority(memTx.tx) { | ||
if _, ok := memTx.senders.Load(peerID); !ok { |
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.
Removed check for isPriority as sometimes a peer does not yet exist when DKG txs are added to mempool. Removing this check allows these txs to be included from the main mempool queue. Since DKG transactions are appended in the front of the queue there will not be many duplicates in the gossip beyond the first few 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.
Sure. Is this just fixing the corner case when the network starts for the first time?
_, err := rand.Read(txBytes) | ||
if err != nil { | ||
t.Error(err) | ||
} | ||
txBytes = tx_extensions.PrependBytes(txBytes) // Convert to priority tx (dkg) | ||
assert.True(t, isPriority(txBytes)) | ||
txs[i] = txBytes |
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.
Having rand after the prepend was messing up prefix and made the tx no longer a priority 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.
👍
// Priority txs are gossiped using peer pointer priority txs so we to do not include | ||
// them here to avoid sending duplicates | ||
if _, ok := memTx.senders.Load(peerID); !ok && !isPriority(memTx.tx) { | ||
if _, ok := memTx.senders.Load(peerID); !ok { |
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.
Sure. Is this just fixing the corner case when the network starts for the first time?
_, err := rand.Read(txBytes) | ||
if err != nil { | ||
t.Error(err) | ||
} | ||
txBytes = tx_extensions.PrependBytes(txBytes) // Convert to priority tx (dkg) | ||
assert.True(t, isPriority(txBytes)) | ||
txs[i] = txBytes |
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.
👍
Bug fix to allow appending of dkg txs to peerPointer. Removed filtering of priority txs in GetNewTxs when getting transactions from main txs queue.