aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/walletdb.cpp
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2023-06-28 15:01:51 -0400
committerAndrew Chow <github@achow101.com>2023-06-28 15:12:12 -0400
commit7952a5934a1e071ca24a51483d058174e7b6de43 (patch)
tree61bfba21a02058c7abb221736095932f4f2ff738 /src/wallet/walletdb.cpp
parentd6ee03507f39223889a5f039c4db7204ddfb91d5 (diff)
parentfa38d862358b87219b12bf31236c52f28d9fc5d6 (diff)
downloadbitcoin-7952a5934a1e071ca24a51483d058174e7b6de43.tar.xz
Merge bitcoin/bitcoin#27927: util: Allow std::byte and char Span serialization
fa38d862358b87219b12bf31236c52f28d9fc5d6 Use only Span{} constructor for byte-like types where possible (MarcoFalke) fa257bc8312b91c2d281f48ca2500d9cba353cc5 util: Allow std::byte and char Span serialization (MarcoFalke) Pull request description: Seems odd to require developers to cast all byte-like spans passed to serialization to `unsigned char`-spans. Fix that by passing and accepting byte-like spans as-is. Finally, add tests and update the code to use just `Span` where possible. ACKs for top commit: sipa: utACK fa38d862358b87219b12bf31236c52f28d9fc5d6 achow101: ACK fa38d862358b87219b12bf31236c52f28d9fc5d6 ryanofsky: Code review ACK fa38d862358b87219b12bf31236c52f28d9fc5d6. This looks great. The second commit really removes a lot of boilerplate and shows why the first commit is useful. Tree-SHA512: 788592d9ff515c3ebe73d48f9ecbb8d239f5b985af86f09974e508cafb0ca6d73a959350295246b4dfb496149bc56330a0b5d659fc434ba6723dbaba0b7a49e5
Diffstat (limited to 'src/wallet/walletdb.cpp')
-rw-r--r--src/wallet/walletdb.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wallet/walletdb.cpp b/src/wallet/walletdb.cpp
index 2aee750ced..ff0b83dc38 100644
--- a/src/wallet/walletdb.cpp
+++ b/src/wallet/walletdb.cpp
@@ -1392,7 +1392,7 @@ bool WalletBatch::EraseRecords(const std::unordered_set<std::string>& types)
}
// Make a copy of key to avoid data being deleted by the following read of the type
- Span<const unsigned char> key_data = MakeUCharSpan(key);
+ Span key_data{key};
std::string type;
key >> type;