Fix lightwalletd sync loop for DragonX wallet
- Handle missing Sapling upgrade in getblockchaininfo response by defaulting activation height to 1 (DragonX has Sapling active from genesis but uses NO_ACTIVATION_HEIGHT in chainparams) - Override consensus branch ID to Sapling (76b809bb) when node reports Sprout (00000000) due to disabled activation heights - Include full serialized block header in CompactBlock so the SDK can validate hashFinalSaplingRoot against the Sapling commitment tree - Set CompactBlock ProtoVersion to 1
This commit is contained in:
@@ -99,12 +99,14 @@ func (b *Block) GetPrevHash() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (b *Block) ToCompact() *walletrpc.CompactBlock {
|
func (b *Block) ToCompact() *walletrpc.CompactBlock {
|
||||||
|
headerBytes, _ := b.hdr.MarshalBinary()
|
||||||
compactBlock := &walletrpc.CompactBlock{
|
compactBlock := &walletrpc.CompactBlock{
|
||||||
//TODO ProtoVersion: 1,
|
ProtoVersion: 1,
|
||||||
Height: uint64(b.GetHeight()),
|
Height: uint64(b.GetHeight()),
|
||||||
PrevHash: b.hdr.HashPrevBlock,
|
PrevHash: b.hdr.HashPrevBlock,
|
||||||
Hash: b.GetEncodableHash(),
|
Hash: b.GetEncodableHash(),
|
||||||
Time: b.hdr.Time,
|
Time: b.hdr.Time,
|
||||||
|
Header: headerBytes,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only Sapling transactions have a meaningful compact encoding
|
// Only Sapling transactions have a meaningful compact encoding
|
||||||
|
|||||||
Reference in New Issue
Block a user