Page MenuHomePhabricator

[wallet] Get rid of CWalletTx default constructor
ClosedPublic

Authored by Fabien on Feb 27 2019, 11:47.

Details

Summary

No change in behavior in the normal case. But buggy mapWallet lookups
with invalid txids will now throw exceptions instead of inserting dummy
entries into the map, and potentially causing segfaults and other
failures.

This also makes it a compiler error to use the mapWallet[hash] syntax
which could create dummy entries.

Partial backport of core PR9680 (commit b4bc32a)
Depends on D2618
Completes T517

Test Plan
make check

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Feb 27 2019, 11:47
Herald added a reviewer: Restricted Project. · View Herald TranscriptFeb 27 2019, 11:47
Herald added a subscriber: schancel. · View Herald Transcript
jasonbcox accepted this revision.Feb 27 2019, 16:32
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
src/qt/walletmodel.cpp
564 ↗(On Diff #7507)

Just noting for other reviewers that a few of these changes are not in the original PR, but are noted in the summary.

src/wallet/wallet.cpp
1144 ↗(On Diff #7507)

Just noting for other reviewers that a few of these changes are not in the original PR, but are noted in the summary.

This revision is now accepted and ready to land.Feb 27 2019, 16:32
This revision was automatically updated to reflect the committed changes.