main: remove spent address utxo indexes
This commit is contained in:
committed by
Braydon Fuller
parent
21c675855f
commit
d0483c9aa0
23
src/main.h
23
src/main.h
@@ -356,21 +356,16 @@ struct CTimestampIndexKey {
|
||||
struct CAddressUnspentKey {
|
||||
unsigned int type;
|
||||
uint160 hashBytes;
|
||||
int blockHeight;
|
||||
unsigned int txindex;
|
||||
uint256 txhash;
|
||||
size_t index;
|
||||
|
||||
size_t GetSerializeSize(int nType, int nVersion) const {
|
||||
return 65;
|
||||
return 57;
|
||||
}
|
||||
template<typename Stream>
|
||||
void Serialize(Stream& s, int nType, int nVersion) const {
|
||||
ser_writedata8(s, type);
|
||||
hashBytes.Serialize(s, nType, nVersion);
|
||||
// Heights are stored big-endian for key sorting in LevelDB
|
||||
ser_writedata32be(s, blockHeight);
|
||||
ser_writedata32be(s, txindex);
|
||||
txhash.Serialize(s, nType, nVersion);
|
||||
ser_writedata32(s, index);
|
||||
}
|
||||
@@ -378,18 +373,13 @@ struct CAddressUnspentKey {
|
||||
void Unserialize(Stream& s, int nType, int nVersion) {
|
||||
type = ser_readdata8(s);
|
||||
hashBytes.Unserialize(s, nType, nVersion);
|
||||
blockHeight = ser_readdata32be(s);
|
||||
txindex = ser_readdata32be(s);
|
||||
txhash.Unserialize(s, nType, nVersion);
|
||||
index = ser_readdata32(s);
|
||||
}
|
||||
|
||||
CAddressUnspentKey(unsigned int addressType, uint160 addressHash, int height, int blockindex,
|
||||
uint256 txid, size_t indexValue) {
|
||||
CAddressUnspentKey(unsigned int addressType, uint160 addressHash, uint256 txid, size_t indexValue) {
|
||||
type = addressType;
|
||||
hashBytes = addressHash;
|
||||
blockHeight = height;
|
||||
txindex = blockindex;
|
||||
txhash = txid;
|
||||
index = indexValue;
|
||||
}
|
||||
@@ -401,8 +391,6 @@ struct CAddressUnspentKey {
|
||||
void SetNull() {
|
||||
type = 0;
|
||||
hashBytes.SetNull();
|
||||
blockHeight = 0;
|
||||
txindex = 0;
|
||||
txhash.SetNull();
|
||||
index = 0;
|
||||
}
|
||||
@@ -430,14 +418,13 @@ struct CAddressUnspentValue {
|
||||
}
|
||||
|
||||
void SetNull() {
|
||||
satoshis = 0;
|
||||
script = CScript();
|
||||
satoshis = -1;
|
||||
script.clear();
|
||||
}
|
||||
|
||||
bool IsNull() const {
|
||||
return (satoshis == 0);
|
||||
return (satoshis == -1);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct CAddressIndexKey {
|
||||
|
||||
Reference in New Issue
Block a user