17 lines
375 B
C++
17 lines
375 B
C++
#include "TxOutput.h"
|
|
#include "VarInt.h"
|
|
|
|
TxOutput::TxOutput(const std::byte *data) {
|
|
_value = *reinterpret_cast<const uint64_t*>(data);
|
|
data += sizeof(_value);
|
|
VarInt scriptPubKeySize(data);
|
|
|
|
// TODO: Read ScriptSizeKey
|
|
|
|
_size = sizeof(_value) + scriptPubKeySize.size() + scriptPubKeySize.value();
|
|
}
|
|
|
|
size_t TxOutput::size() const {
|
|
return _size;
|
|
}
|