ingest: make zmq client store raw transaction data
This commit is contained in:
@@ -9,8 +9,8 @@ import (
|
||||
)
|
||||
|
||||
type block struct {
|
||||
hdr *blockHeader
|
||||
vtx []*transaction
|
||||
hdr *blockHeader
|
||||
vtx []*Transaction
|
||||
}
|
||||
|
||||
func NewBlock() *block {
|
||||
@@ -25,6 +25,11 @@ func (b *block) GetTxCount() int {
|
||||
return len(b.vtx)
|
||||
}
|
||||
|
||||
func (b *block) Transactions() []*Transaction {
|
||||
// TODO: these should NOT be mutable
|
||||
return b.vtx
|
||||
}
|
||||
|
||||
// GetDisplayHash returns the block hash in big-endian display order.
|
||||
func (b *block) GetDisplayHash() []byte {
|
||||
return b.hdr.GetDisplayHash()
|
||||
@@ -101,7 +106,7 @@ func (b *block) ParseFromSlice(data []byte) (rest []byte, err error) {
|
||||
}
|
||||
data = []byte(s)
|
||||
|
||||
vtx := make([]*transaction, 0, txCount)
|
||||
vtx := make([]*Transaction, 0, txCount)
|
||||
for i := 0; len(data) > 0; i++ {
|
||||
tx := NewTransaction()
|
||||
data, err = tx.ParseFromSlice(data)
|
||||
|
||||
Reference in New Issue
Block a user