Skip to content
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

Merged
merged 5 commits into from Oct 12, 2016

Conversation

jrick
Copy link
Member

@jrick jrick commented Oct 12, 2016

No description provided.

@@ -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() {
Copy link
Member

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() {
Copy link
Member

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() {
Copy link
Member

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 {

@cjepson
Copy link
Contributor

cjepson commented Oct 12, 2016

OK

Copy link
Member

@dajohi dajohi left a 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
Copy link
Contributor

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()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/mstx/smtx maybe ?

Copy link
Member Author

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

@jrick jrick merged commit d58299b into decred:master Oct 12, 2016
@jrick jrick deleted the lessutiltx branch October 12, 2016 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants