This commit is contained in:
jl777
2016-12-09 16:06:50 +02:00
parent 9b570fb1f2
commit fa0d10cc5c

View File

@@ -18,13 +18,13 @@
uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest) uint64_t komodo_earned_interest(int32_t height,int64_t paidinterest)
{ {
static uint64_t *interests; static int32_t maxheight; static uint64_t *interests; static int32_t maxheight;
uint64_t total; int32_t ind,incr = 1000000; uint64_t total; int32_t ind,incr = 100000;
if ( height >= maxheight ) if ( height >= maxheight )
{ {
if ( interests == 0 ) if ( interests == 0 )
{ {
interests = (uint64_t *)calloc(incr,sizeof(*interests) * 2); // fix before block 1 million maxheight = height + incr;
maxheight += incr; interests = (uint64_t *)calloc(maxheight,sizeof(*interests) * 2);
} }
else else
{ {