main: sort address index utxos by height

This commit is contained in:
Braydon Fuller
2016-03-30 16:42:37 -04:00
committed by Braydon Fuller
parent d0483c9aa0
commit 1bd65a5c4b
4 changed files with 31 additions and 6 deletions

View File

@@ -399,6 +399,7 @@ struct CAddressUnspentKey {
struct CAddressUnspentValue {
CAmount satoshis;
CScript script;
int blockHeight;
ADD_SERIALIZE_METHODS;
@@ -406,11 +407,13 @@ struct CAddressUnspentValue {
inline void SerializationOp(Stream& s, Operation ser_action, int nType, int nVersion) {
READWRITE(satoshis);
READWRITE(*(CScriptBase*)(&script));
READWRITE(blockHeight);
}
CAddressUnspentValue(CAmount sats, CScript scriptPubKey) {
CAddressUnspentValue(CAmount sats, CScript scriptPubKey, int height) {
satoshis = sats;
script = scriptPubKey;
blockHeight = height;
}
CAddressUnspentValue() {
@@ -420,6 +423,7 @@ struct CAddressUnspentValue {
void SetNull() {
satoshis = -1;
script.clear();
blockHeight = 0;
}
bool IsNull() const {