update
This commit is contained in:
parent
ce8efb9890
commit
4d4596a641
|
@ -217,17 +217,17 @@ func update_block_confirm(gbt *GbtAlphContext) {
|
|||
blockInfo := gbt.GbtCtx.ClientAlphApi.GetBlcokInfo(blockHash)
|
||||
var total_amount float64 = 0
|
||||
fromGroup, toGroup, nonce, height := blockInfo.ChainFrom, blockInfo.ChainTo, blockInfo.Nonce, blockInfo.Height
|
||||
for _, tx := range blockInfo.Transactions {
|
||||
for _, out := range tx.Unsigned.FixedOutputs {
|
||||
if out.Address == addr[fromGroup] && nonce == blockInfo.Nonce {
|
||||
amount := out.AttoAlphAmount
|
||||
total_amount += savePoint4(stringToFloat64(amount) / math.Pow(10, 18))
|
||||
fmt.Println(fromGroup, "->", toGroup, "(", height, "):", total_amount, ",", nonce, " ", blockHash, " ", out.Address, " 报块成功")
|
||||
} else {
|
||||
fmt.Println(fromGroup, "->", toGroup, "(", height, "):", total_amount, ",", nonce, "不是报块,实际报块地址为:", out.Address)
|
||||
}
|
||||
// for _, tx := range blockInfo.Transactions {
|
||||
for _, out := range blockInfo.Transactions[len(blockInfo.Transactions)-1].Unsigned.FixedOutputs {
|
||||
if out.Address == addr[fromGroup] && nonce == blockInfo.Nonce {
|
||||
amount := out.AttoAlphAmount
|
||||
total_amount += savePoint4(stringToFloat64(amount) / math.Pow(10, 18))
|
||||
fmt.Println(fromGroup, "->", toGroup, "(", height, "):", total_amount, ",", nonce, " ", blockHash, " ", out.Address, " 报块成功")
|
||||
} else {
|
||||
fmt.Println(fromGroup, "->", toGroup, "(", height, "):", total_amount, ",", nonce, "不是报块,实际报块地址为:", out.Address)
|
||||
}
|
||||
}
|
||||
// }
|
||||
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))
|
||||
|
|
Loading…
Reference in New Issue