From ce8efb98901ee5a16f2d4f7c3274ac0c0345a038 Mon Sep 17 00:00:00 2001 From: lzx <393768033@qq.com> Date: Wed, 16 Apr 2025 16:46:30 +0800 Subject: [PATCH] fix alph height use blockChain height --- internal/gbt/alph/alph.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/internal/gbt/alph/alph.go b/internal/gbt/alph/alph.go index 21b5079..322e064 100644 --- a/internal/gbt/alph/alph.go +++ b/internal/gbt/alph/alph.go @@ -228,18 +228,7 @@ func update_block_confirm(gbt *GbtAlphContext) { } } } - // if len(input) == 0 { - // for v := range output { - // address, amount := output[v].Address, output[v].AttoAlphAmount - // if address == addr[fromGroup] && nonce == block.Nonce { - // total_amount += savePoint4(stringToFloat64(amount) / math.Pow(10, 18)) - // fmt.Println(fromGroup, "->", toGroup, "(", height, "):", total_amount, ",", nonce, " ", blockHash, " ", address, " 报块成功") - // } else { - // fmt.Println(fromGroup, "->", toGroup, "(", height, "):", total_amount, ",", nonce, "不是报块,实际报块地址为:", address) - // } - // } - // } - block_height := int64(block.Height) + block_height := height // 用区块链返回的height,防止某个块成为下一个高度的叔块,导致高度变化 dbif.AlphNotifyPoolBlkStatsSuccess(gbt.GbtCtx, uint32(fromGroup), uint32(toGroup), block_height, "", block.Nonce, int64(block.SubIdx), total_amount, 0) dbif.NotifyAlphBlkDetailSuccess(gbt.GbtCtx, uint32(fromGroup), uint32(toGroup), block_height, "", block.Nonce, int64(block.SubIdx)) dbif.NotifyAlphBlkNewDb(gbt.GbtCtx, uint32(fromGroup), uint32(toGroup), block_height, block.Hash, true, block.Nonce, int64(block.SubIdx))