elements/src/rpc
Wladimir J. van der Laan f0c9e1c22b
Merge #14906: refactor: Make explicit CMutableTransaction -> CTransaction conversion.
b301950df3  Made expicit constructor CTransaction(const CMutableTransaction &tx). (lucash-dev)
faf29dd019  Minimal changes to comply with explicit CMutableTransaction -> CTranaction conversion. (lucash-dev)

Pull request description:

  This PR is re-submission of #14156, which was automatically closed by github (glitch?)

  Original description:

  This PR makes explicit the now implicit conversion constructor `CTransaction(const CMutableTransaction&)` in `transaction.h`.
  Minimal changes were made elsewhere to make the code compilable. I'll follow up with other PRs to address individually refactoring functions that should have a `CMutableTransaction` version, or where a `CTransaction` should be reused.

  The rationale for this change is:

   - Conversion constructors should not be explicit unless there's a strong reason for it (in the opinion of, for example, https://google.github.io/styleguide/cppguide.html, and https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Ro-conversion. Let me know your take on this).
   - This particular conversion is very costly -- it implies a serialization plus hash of the transaction.
   - Even though `CTransaction` and `CMutableTransaction` represent the same data, they have very different use cases and performance properties.
   - Making it explicit allows for easier reasoning of performance trade-offs.
   - There has been previous performance issues caused by unneeded use of this implicit conversion.
   - This PR creates a map for places to look for possible refactoring and performance gains (this benefit still holds if the PR is not merged).

Tree-SHA512: 2427462e7211b5ffc7299dae17339d27f8c43266e0895690fda49a83c72751bd2489d4471b3993075a18f3fef25d741243e5010b2f49aeef4a9688b30b6d0631
2019-01-21 20:28:56 +01:00
..
blockchain.cpp Merge #12153: Avoid permanent cs_main lock in getblockheader 2019-01-08 13:53:35 +01:00
blockchain.h rpc: Remove cs_main lock from blockToJSON and blockHeaderToJSON 2018-09-09 18:02:24 +01:00
client.cpp rpc: Add wait argument to stop 2018-11-23 16:54:22 +00:00
client.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
mining.cpp Merge #14811: Mining: Enforce that segwit option must be set in GBT 2018-12-21 13:46:06 +01:00
mining.h scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
misc.cpp rpc: Document default values for optional arguments 2018-12-07 11:53:29 -05:00
net.cpp net: move BanMan to its own files 2019-01-16 13:54:18 -05:00
protocol.cpp scripted-diff: Move util files to separate directory. 2018-11-04 22:46:07 -08:00
protocol.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
rawtransaction.cpp Merge #14906: refactor: Make explicit CMutableTransaction -> CTransaction conversion. 2019-01-21 20:28:56 +01:00
rawtransaction.h Pass chain and client variables where needed 2018-11-06 11:44:40 -04:00
register.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
server.cpp Merge #14982: rpc: Add getrpcinfo command 2019-01-14 18:07:15 +01:00
server.h convert C-style (void) parameter lists to C++ style () 2018-09-13 10:36:41 -07:00
util.cpp RPCHelpMan: Support required arguments after optional ones 2018-12-10 14:08:20 -05:00
util.h Merge #14877: rpc: Document default values for optional arguments 2018-12-10 14:02:21 -05:00