Golang implemented sidechain for Bytom
Revision | 524968c3b01201b00f4c8f2afd524d76b371d316 (tree) |
---|---|
Time | 2019-11-27 10:57:43 |
Author | HAOYUatHZ <haoyu@prot...> |
Commiter | HAOYUatHZ |
minor
@@ -222,7 +222,7 @@ func addMatchTxOutput(txData *types.TxData, txInput *types.TxInput, order *commo | ||
222 | 222 | } |
223 | 223 | |
224 | 224 | func CalcRequestAmount(fromAmount uint64, contractArg *vmutil.MagneticContractArgs) uint64 { |
225 | - res := big.NewInt(int64(fromAmount)) | |
225 | + res := big.NewInt(0).SetUint64(fromAmount) | |
226 | 226 | res.Mul(res, big.NewInt(contractArg.RatioNumerator)).Div(res, big.NewInt(contractArg.RatioDenominator)) |
227 | 227 | if !res.IsUint64() { |
228 | 228 | return 0 |