From 69b8e1028d08230dd44e4d897909495e626137eb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Dec 2018 05:51:40 -1100 Subject: [PATCH 1/3] Dont retry failed bigger amounts in migrate --- src/cc/dapps/zmigrate.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 73bff3276..42e7d0fe5 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -932,7 +932,7 @@ again: if ( (amount= find_sprout_amount(coinstr,zcaddr)) > txfee ) { // generate taddr, send max of 10000.0001 - static int64_t lastamount,lastamount2,lastamount3,lastamount4; + static int64_t lastamount,lastamount2,lastamount3,lastamount4,refamount = 500 * SATOSHIDEN; stdamount = 500 * SATOSHIDEN; if ( amount == lastamount && amount == lastamount2 ) { @@ -940,6 +940,10 @@ again: if ( amount == lastamount3 && amount == lastamount4 ) stdamount /= 5; } + if ( stdamount < refamount ) + refamount = stdamount; + else if ( refamount > stdamount ) + stdamount = refamount; lastamount4 = lastamount3; lastamount3 = lastamount2; lastamount2 = lastamount; From 3eb0194063c4e23c6b423193a5e4e790c6d8cf92 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Dec 2018 05:57:34 -1100 Subject: [PATCH 2/3] Start at 5000 --- src/cc/dapps/zmigrate.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 42e7d0fe5..31928c7d1 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -932,18 +932,16 @@ again: if ( (amount= find_sprout_amount(coinstr,zcaddr)) > txfee ) { // generate taddr, send max of 10000.0001 - static int64_t lastamount,lastamount2,lastamount3,lastamount4,refamount = 500 * SATOSHIDEN; - stdamount = 500 * SATOSHIDEN; + static int64_t lastamount,lastamount2,lastamount3,lastamount4,refamount = 5000 * SATOSHIDEN; + stdamount = refamount; if ( amount == lastamount && amount == lastamount2 ) { stdamount /= 10; if ( amount == lastamount3 && amount == lastamount4 ) - stdamount /= 5; + stdamount /= 10; } if ( stdamount < refamount ) refamount = stdamount; - else if ( refamount > stdamount ) - stdamount = refamount; lastamount4 = lastamount3; lastamount3 = lastamount2; lastamount2 = lastamount; From ba0c0794ebcdd7c7883a00f847c830b83ae7180e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 15 Dec 2018 07:43:08 -1100 Subject: [PATCH 3/3] Add three to migrate --- src/cc/dapps/zmigrate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cc/dapps/zmigrate.c b/src/cc/dapps/zmigrate.c index 31928c7d1..84cf4b057 100644 --- a/src/cc/dapps/zmigrate.c +++ b/src/cc/dapps/zmigrate.c @@ -946,8 +946,8 @@ again: lastamount3 = lastamount2; lastamount2 = lastamount; lastamount = amount; - if ( amount > stdamount+txfee ) - amount = stdamount + txfee; + if ( amount > stdamount+2*txfee ) + amount = stdamount + 2*txfee; if ( getnewaddress(coinaddr,coinstr,"") == 0 ) { z_sendmany(opidstr,coinstr,"",zcaddr,coinaddr,amount-txfee);