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
Replace some unnecessary dcrutil.Tx usage with wire.MsgTx. #419
Conversation
@@ -178,8 +178,9 @@ func (b *BlockChain) checkBlockContext(block *dcrutil.Block, prevNode *blockNode | |||
func ticketsSpentInBlock(bl *dcrutil.Block) []chainhash.Hash { | |||
var tickets []chainhash.Hash | |||
for _, stx := range bl.STransactions() { |
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.
Perhaps change;
for _, stx := range bl.STransactions() {
to
for _, mstx := range bl.MsgBlock().Sransactions {
and drop
mstx := stx.MsgTx()
@@ -191,8 +191,9 @@ func ticketsSpentInBlock(bl *dcrutil.Block) []chainhash.Hash { | |||
func ticketsRevokedInBlock(bl *dcrutil.Block) []chainhash.Hash { | |||
var tickets []chainhash.Hash | |||
for _, stx := range bl.STransactions() { |
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.
for _, stx := range bl.MsgBlock().STransactions {
@@ -1418,12 +1418,13 @@ func countSpentOutputs(block *dcrutil.Block, parent *dcrutil.Block) int { | |||
} | |||
} | |||
for _, stx := range block.STransactions() { |
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.
for _, stx := range bl.MsgBlock().STransactions {
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.
OK
if txType == stake.TxTypeSSGen { | ||
ticketH := stx.MsgTx().TxIn[1].PreviousOutPoint.Hash | ||
ticketH := mstx.TxIn[1].PreviousOutPoint.Hash |
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.
s/mstx/smtx maybe ?
@@ -659,8 +659,9 @@ func maybeInsertStakeTx(bm *blockManager, stx *dcrutil.Tx, treeValid bool) bool | |||
"stx %s: %v", stx.Sha(), err) | |||
return false | |||
} | |||
isSSGen, _ := stake.IsSSGen(stx) | |||
for i, txIn := range stx.MsgTx().TxIn { | |||
mstx := stx.MsgTx() |
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.
s/mstx/smtx maybe ?
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.
neither is better than the other. not worth changing
No description provided.