mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 19:43:13 +02:00
refactor: Use ignore helper when unserializing an invalid pubkey
This commit is contained in:
@@ -141,7 +141,7 @@ public:
|
|||||||
template <typename Stream>
|
template <typename Stream>
|
||||||
void Unserialize(Stream& s)
|
void Unserialize(Stream& s)
|
||||||
{
|
{
|
||||||
unsigned int len = ::ReadCompactSize(s);
|
const unsigned int len(::ReadCompactSize(s));
|
||||||
if (len <= SIZE) {
|
if (len <= SIZE) {
|
||||||
s.read((char*)vch, len);
|
s.read((char*)vch, len);
|
||||||
if (len != size()) {
|
if (len != size()) {
|
||||||
@@ -149,9 +149,7 @@ public:
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// invalid pubkey, skip available data
|
// invalid pubkey, skip available data
|
||||||
char dummy;
|
s.ignore(len);
|
||||||
while (len--)
|
|
||||||
s.read(&dummy, 1);
|
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user