From 41ed65c8381b7634d495175058ffd585f1c91d48 Mon Sep 17 00:00:00 2001 From: jl777 Date: Mon, 9 Apr 2018 20:25:20 +0300 Subject: [PATCH] Test --- src/komodo_gateway.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/komodo_gateway.h b/src/komodo_gateway.h index 10edb63db..bf172052c 100644 --- a/src/komodo_gateway.h +++ b/src/komodo_gateway.h @@ -676,6 +676,8 @@ uint32_t komodo_stake(arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_ if ( nHeight < 200 ) return(blocktime); txtime = komodo_txtime(&value,txid,vout); + if ( value == 0 ) + return(0); minutes = (blocktime - txtime) / 60; if ( txtime == 0 ) txtime = prevtime; @@ -684,7 +686,7 @@ uint32_t komodo_stake(arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_ hash = pindex->GetBlockHash(); // hash pubkey diff = (blocktime - txtime); coinage = value * diff / supply; - hashval = (UintToArith256(hash) / arith_uint256(coinage+1)); + hashval = arith_uint256(1000000) * (UintToArith256(hash) / arith_uint256(coinage+1)); if ( hashval <= bnTarget ) winner = 1; else @@ -698,7 +700,7 @@ uint32_t komodo_stake(arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_ { diff = (i + blocktime - txtime); coinage = value * diff / supply; - hashval = (UintToArith256(hash) / arith_uint256(coinage+1)); + hashval = arith_uint256(1000000) * (UintToArith256(hash) / arith_uint256(coinage+1)); if ( hashval <= bnTarget ) { winner = 1;