mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-06 13:47:56 +02:00
Merge bitcoin/bitcoin#34483: refactor: Use SpanReader over DataStream
fa0677d131refactor: Use SpanReader over DataStream (MarcoFalke)fad3eb3956refactor: Use SpanReader over DataStream (MarcoFalke)fa06e26764refactor: [qt] Use SpanReader to avoid two vector copies (MarcoFalke)fabd4d2e2erefactor: Avoid UB in SpanReader::ignore (MarcoFalke)fa20bc2ec2refactor: Use empty() over eof() in the streams interface (MarcoFalke)fa879db735test: Read debug log for self-checking comment (MarcoFalke) Pull request description: This changes all places, where possible, to use SpanReader over DataStream. This makes the code easier to read and reason about, because `SpanReader` can never write data. Also, the code should be minimally faster, because it avoids a full redundant copy of the whole vector of bytes. ACKs for top commit: stickies-v: re-ACKfa0677d131achow101: ACKfa0677d131janb84: re ACKfa0677d131sipa: crACKfa0677d131Tree-SHA512: 1d9f43fc6e71d481cf7b8f8457f479745ee331734649e9e2c2ab00ce5d317112796c77afc328612ed004e65ac5c16fc92279d760cfb012cfddce9098c4af810f
This commit is contained in:
@@ -377,7 +377,7 @@ bool LoadCryptedKey(CWallet* pwallet, DataStream& ssKey, DataStream& ssValue, st
|
||||
|
||||
// Get the checksum and check it
|
||||
bool checksum_valid = false;
|
||||
if (!ssValue.eof()) {
|
||||
if (!ssValue.empty()) {
|
||||
uint256 checksum;
|
||||
ssValue >> checksum;
|
||||
if (!(checksum_valid = Hash(vchPrivKey) == checksum)) {
|
||||
|
||||
Reference in New Issue
Block a user