Permalink
Browse files

moved "index_in_template" to a separate variable to clarify what it is

  • Loading branch information...
1 parent 0f927ce commit f3d872d1eabeb5c999162f709626ee20c8789c42 @forrestv committed Jan 4, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/rpcmining.cpp
View
@@ -307,8 +307,9 @@ Value getblocktemplate(const Array& params, bool fHelp)
}
entry.push_back(Pair("depends", deps));
- entry.push_back(Pair("fee", pblocktemplate->vTxFees[&tx - pblock->vtx.data()]));
- entry.push_back(Pair("sigops", pblocktemplate->vTxSigOps[&tx - pblock->vtx.data()]));
+ int index_in_template = &tx - pblock->vtx.data();
+ entry.push_back(Pair("fee", pblocktemplate->vTxFees[index_in_template]));
+ entry.push_back(Pair("sigops", pblocktemplate->vTxSigOps[index_in_template]));
transactions.push_back(entry);
}

0 comments on commit f3d872d

Please sign in to comment.