aboutsummaryrefslogtreecommitdiff
path: root/src/undo.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2018-03-15 16:48:42 -0700
committerPieter Wuille <pieter.wuille@gmail.com>2018-03-15 16:57:55 -0700
commit7be9a9a570c1140048f8781ced1111e1d930e517 (patch)
treee5c1fe3eb3607fb5d8997805990fc633d553c4dd /src/undo.h
parent2bac3e484114c30548e286972525dd799dbd0a5b (diff)
parent172f5fa738d419efda99542e2ad2a0f4db5be580 (diff)
downloadbitcoin-7be9a9a570c1140048f8781ced1111e1d930e517.tar.xz
Merge #12683: Fix more constness violations in serialization code
172f5fa738 Support deserializing into temporaries (Pieter Wuille) 2761bca997 Merge READWRITEMANY into READWRITE (Pieter Wuille) Pull request description: This is another fragment of improvements from #10785. The current serialization code does not support serializing/deserializing from/to temporaries (like `s >> CFlatData(script)`). As a result, there are many invocations of the `REF` macro which in addition to changing the reference type also changes the constness. This is unnecessary in C++11 as we can use rvalue references now instead. The first commit is an extra simplification we can make that removes the duplication of code between `READWRITE` and `READWRITEMANY` (and related functions). Tree-SHA512: babfa9cb268cc3bc39917e4f0a90e4651c33d85032161e16547a07f3b257b7ca7940e0cbfd69f09439d26fafbb1a6cf6359101043407e2c7aeececf7f20b6eed
Diffstat (limited to 'src/undo.h')
-rw-r--r--src/undo.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/undo.h b/src/undo.h
index 1f10c6652c..7aae034de2 100644
--- a/src/undo.h
+++ b/src/undo.h
@@ -54,7 +54,7 @@ public:
int nVersionDummy;
::Unserialize(s, VARINT(nVersionDummy));
}
- ::Unserialize(s, REF(CTxOutCompressor(REF(txout->out))));
+ ::Unserialize(s, CTxOutCompressor(REF(txout->out)));
}
explicit TxInUndoDeserializer(Coin* coin) : txout(coin) {}
@@ -76,7 +76,7 @@ public:
uint64_t count = vprevout.size();
::Serialize(s, COMPACTSIZE(REF(count)));
for (const auto& prevout : vprevout) {
- ::Serialize(s, REF(TxInUndoSerializer(&prevout)));
+ ::Serialize(s, TxInUndoSerializer(&prevout));
}
}
@@ -90,7 +90,7 @@ public:
}
vprevout.resize(count);
for (auto& prevout : vprevout) {
- ::Unserialize(s, REF(TxInUndoDeserializer(&prevout)));
+ ::Unserialize(s, TxInUndoDeserializer(&prevout));
}
}
};