lbrycrd/src
Wladimir J. van der Laan af88094e4f
Merge #12658: Sanitize some wallet serialization
42343c748 Split up and sanitize CAccountingEntry serialization (Pieter Wuille)
029ecac1b Split up and sanitize CWalletTx serialization (Pieter Wuille)

Pull request description:

  This is a small subset of changes taken from #10785, fixing a few of the craziest constness violations in the serialization code.

  `CWalletTx` currently serializes some of its fields by embedding them in a key-value `mapValue`, which is modified (and then fixed up) even from the `Serialize` method (for which `mapValue` is const). `CAccountingEntry` goes even further in that it stores such a map by appending it into `strComment` after a null char, which is again later fixed up again.

  Fix this by splitting the serialization and deserialization code, and making the serialization act on a copy of `mapValue` / `strComment`.

Tree-SHA512: 487e04996dea6aba5b9b8bdaf2c4e680808f111a15afc557b8d078e14b01e4f40f8ef27588869be62f9a87052117c17e0a0c26c59150f83472a9076936af035e
2018-03-13 18:39:55 +01:00
..
bench Allow wallet files in multiple directories 2018-03-03 10:26:55 -05:00
compat Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
config
consensus Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
crypto Consensus: Fix bug when compiler do not support __builtin_clz* 2018-03-01 17:20:27 +08:00
leveldb Bump leveldb subtree 2018-02-16 08:59:28 -05:00
obj
obj-test
policy fee estimator: avoid sorting mempool on shutdown 2018-01-25 18:02:24 -05:00
primitives Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
qt Format timestamps using ISO 8601 formatting (e.g. "2018-02-28T12:34:56Z") 2018-03-09 15:02:01 +01:00
rpc Merge #11872: [rpc] createrawtransaction: Accept sorted outputs 2018-03-13 18:00:06 +01:00
script Merge #11900: [script] simplify CheckMinimalPush checks, add safety assert 2018-03-07 17:18:14 +01:00
secp256k1 Bump secp256k1 subtree 2017-09-29 16:02:39 +02:00
support Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
test Merge #11872: [rpc] createrawtransaction: Accept sorted outputs 2018-03-13 18:00:06 +01:00
univalue univalue: Bump subtree 2018-02-10 09:55:54 -05:00
wallet Merge #12658: Sanitize some wallet serialization 2018-03-13 18:39:55 +01:00
zmq Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
.clang-format Merge #10193: scripted-diff: Remove #include <boost/foreach.hpp> 2017-07-04 18:05:18 +02:00
addrdb.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
addrdb.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
addrman.cpp net: Correct addrman logging 2018-03-06 21:52:53 +01:00
addrman.h Add test-before-evict discipline to addrman 2018-03-06 11:21:01 -05:00
amount.h Consensus: Policy: MOVEONLY: Move CFeeRate out of the consensus module 2017-05-03 18:00:13 +02:00
arith_uint256.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
arith_uint256.h [arith_uint256] Avoid unnecessary this-copy using prefix operator 2018-02-28 19:59:19 +09:00
base58.cpp Split key_io (address/key encodings) off from base58 2018-02-19 18:55:21 -08:00
base58.h Split key_io (address/key encodings) off from base58 2018-02-19 18:55:21 -08:00
bech32.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
bech32.h Import Bech32 C++ reference code & tests 2017-09-28 16:02:16 -07:00
bitcoin-cli-res.rc
bitcoin-cli.cpp Create new wallet databases as directories rather than files 2018-03-03 10:26:55 -05:00
bitcoin-tx-res.rc
bitcoin-tx.cpp Merge #10694: Remove redundant code in MutateTxSign(CMutableTransaction&, const std::string&) 2018-03-13 16:59:50 +01:00
bitcoind-res.rc
bitcoind.cpp Move scheduler/threadGroup into common-init instead of per-app 2018-01-25 11:35:34 -05:00
blockencodings.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
blockencodings.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bloom.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
bloom.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
chain.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
chain.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
chainparams.cpp Disable wallet fallbackfee by default on mainnet 2018-02-25 09:33:46 +08:00
chainparams.h Disable wallet fallbackfee by default on mainnet 2018-02-25 09:33:46 +08:00
chainparamsbase.cpp Refactor: One CBaseChainParams should be enough 2018-02-08 22:06:43 +01:00
chainparamsbase.h Refactor: One CBaseChainParams should be enough 2018-02-08 22:06:43 +01:00
chainparamsseeds.h Fix a-vs-an typos 2018-02-11 10:48:15 +01:00
checkpoints.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
checkpoints.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
checkqueue.h [Refactor] Remove unused fQuit var from checkqueue.h 2018-01-07 20:44:21 +00:00
clientversion.cpp Merge #11966: clientversion: Use full commit hash for commit-based version descriptions 2018-02-13 10:58:41 +01:00
clientversion.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
coins.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
coins.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
compat.h Add new prevector benchmarks. 2018-02-27 11:42:06 -08:00
compressor.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
compressor.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
core_io.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
core_memusage.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
core_read.cpp Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
core_write.cpp Split key_io (address/key encodings) off from base58 2018-02-19 18:55:21 -08:00
cuckoocache.h Fix header guards using reserved identifiers 2017-08-26 02:56:53 +03:00
dbwrapper.cpp Log fatal LevelDB errors more verbosely 2018-03-09 22:51:10 -08:00
dbwrapper.h Add DynamicMemoryUsage() to LevelDB 2018-03-06 00:25:39 -05:00
fs.cpp scripted-diff: Replace #include "" with #include <> (ryanofsky) 2017-11-16 08:23:01 +13:00
fs.h [Trivial] Add BITCOIN_FS_H endif footer in fs.h 2017-05-19 02:01:28 -07:00
hash.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
hash.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
httprpc.cpp Split key_io (address/key encodings) off from base58 2018-02-19 18:55:21 -08:00
httprpc.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
httpserver.cpp Merge #12366: http: Join worker threads before deleting work queue 2018-02-08 09:21:49 +01:00
httpserver.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
indirectmap.h
init.cpp Format timestamps using ISO 8601 formatting (e.g. "2018-02-28T12:34:56Z") 2018-03-09 15:02:01 +01:00
init.h Move scheduler/threadGroup into common-init instead of per-app 2018-01-25 11:35:34 -05:00
key.cpp Merge #9598: Improve readability by removing redundant casts to same type (on all platforms) 2018-03-07 17:47:46 +01:00
key.h Make CKey::Load references const 2018-01-23 13:16:56 -05:00
key_io.cpp Simplify Base32 and Base64 conversions 2018-03-07 07:04:07 -08:00
key_io.h Split key_io (address/key encodings) off from base58 2018-02-19 18:55:21 -08:00
keystore.cpp Merge #11403: SegWit wallet support 2018-01-10 20:55:41 -10:00
keystore.h Merge #11403: SegWit wallet support 2018-01-10 20:55:41 -10:00
limitedmap.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
Makefile.am Merge #11372: Address encoding cleanup 2018-03-07 00:09:48 +01:00
Makefile.bench.include Add new prevector benchmarks. 2018-02-27 11:42:06 -08:00
Makefile.leveldb.include build: verify that the assembler can handle crc32 functions 2017-07-13 12:49:05 -04:00
Makefile.qt.include Merge #11621: [build] Add temp_bitcoin_locale_qrc to CLEAN_QT to fix make distcheck 2017-11-17 14:04:02 +01:00
Makefile.qttest.include Remove redundant testutil files 2017-09-05 15:02:17 +12:00
Makefile.test.include Split off key_io_tests from base58_tests 2018-02-19 18:55:21 -08:00
memusage.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
merkleblock.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
merkleblock.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
miner.cpp [doc] dev-notes: Members should be initialized 2018-02-16 14:21:52 -05:00
miner.h Use mempool's ancestor sort in transaction selection 2018-01-13 15:57:30 -05:00
net.cpp Format timestamps using ISO 8601 formatting (e.g. "2018-02-28T12:34:56Z") 2018-03-09 15:02:01 +01:00
net.h Merge #10387: Eventually connect to NODE_NETWORK_LIMITED peers 2018-03-01 15:31:15 +01:00
net_processing.cpp Add documentation to PeerLogicValidation interface and related functions 2018-03-06 14:43:32 -05:00
net_processing.h Add documentation to PeerLogicValidation interface and related functions 2018-03-06 14:43:32 -05:00
netaddress.cpp Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
netaddress.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
netbase.cpp Remove useless string initialization. 2018-02-13 20:47:55 +01:00
netbase.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
netmessagemaker.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
noui.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
noui.h
pow.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
pow.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
prevector.h Use memset() to optimize prevector::resize() 2018-02-27 13:27:51 -08:00
protocol.cpp Add setter for g_initial_block_download_completed 2018-02-17 21:28:50 +11:00
protocol.h Add setter for g_initial_block_download_completed 2018-02-17 21:28:50 +11:00
pubkey.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
pubkey.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
random.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
random.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
rest.cpp Remove useless string initialization. 2018-02-13 20:47:55 +01:00
reverse_iterator.h Declare single-argument (non-converting) constructors "explicit" 2017-08-16 16:33:25 +02:00
reverselock.h
scheduler.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
scheduler.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
serialize.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
streams.h Fix typos 2018-01-28 13:21:25 +01:00
sync.cpp Fix typos 2018-01-28 13:21:25 +01:00
sync.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
threadinterrupt.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
threadinterrupt.h
threadsafety.h
timedata.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
timedata.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
tinyformat.h [Util] Update tinyformat.h 2017-10-29 21:12:12 +08:00
torcontrol.cpp boost: drop boost threads from torcontrol 2018-02-08 14:35:29 -05:00
torcontrol.h boost: drop boost threads from torcontrol 2018-02-08 14:35:29 -05:00
txdb.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
txdb.h Merge #10498: Use static_cast instead of C-style casts for non-fundamental types 2018-02-07 16:15:28 -05:00
txmempool.cpp Remove unused mempool index 2018-01-09 08:59:21 -05:00
txmempool.h Avoid leaking prioritization information when relaying transactions 2018-01-25 18:02:24 -05:00
ui_interface.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
ui_interface.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
uint256.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
uint256.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
undo.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
util.cpp Format timestamps using ISO 8601 formatting (e.g. "2018-02-28T12:34:56Z") 2018-03-09 15:02:01 +01:00
util.h Merge #10271: Use std:🧵:hardware_concurrency, instead of Boost, to determine available cores 2018-03-06 19:21:34 +01:00
utilmoneystr.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
utilmoneystr.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
utilstrencodings.cpp Simplify Base32 and Base64 conversions 2018-03-07 07:04:07 -08:00
utilstrencodings.h Generalize ConvertBits 2018-03-06 20:28:08 -08:00
utiltime.cpp Format timestamps using ISO 8601 formatting (e.g. "2018-02-28T12:34:56Z") 2018-03-09 15:02:01 +01:00
utiltime.h Format timestamps using ISO 8601 formatting (e.g. "2018-02-28T12:34:56Z") 2018-03-09 15:02:01 +01:00
validation.cpp Format timestamps using ISO 8601 formatting (e.g. "2018-02-28T12:34:56Z") 2018-03-09 15:02:01 +01:00
validation.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
validationinterface.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
validationinterface.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
version.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
versionbits.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
versionbits.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
warnings.cpp Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00
warnings.h Increment MIT Licence copyright header year on files modified in 2017 2018-01-03 02:26:56 +09:00