parser: stop sending non-Sapling transactions (e.g. coinbase) in compact block vtx
This commit is contained in:
parent
f0c2405593
commit
f35e72923a
|
@ -75,10 +75,15 @@ func (b *block) ToCompact() *rpc.CompactBlock {
|
|||
Hash: b.GetEncodableHash(),
|
||||
//TODO Time: b.hdr.Time,
|
||||
}
|
||||
compactBlock.Vtx = make([]*rpc.CompactTx, len(b.vtx))
|
||||
|
||||
// Only Sapling transactions have a meaningful compact encoding
|
||||
saplingTxns := make([]*rpc.CompactTx, 0, len(b.vtx))
|
||||
for idx, tx := range b.vtx {
|
||||
compactBlock.Vtx[idx] = tx.ToCompact(idx)
|
||||
if tx.HasSaplingTransactions() {
|
||||
saplingTxns = append(saplingTxns, tx.ToCompact(idx))
|
||||
}
|
||||
}
|
||||
compactBlock.Vtx = saplingTxns
|
||||
return compactBlock
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue