@ -133,15 +133,12 @@ def main():
if int ( options . txfee ) > 0 :
if int ( options . txfee ) > 0 :
jm_single ( ) . config . set ( " POLICY " , " tx_fees " , str ( options . txfee ) )
jm_single ( ) . config . set ( " POLICY " , " tx_fees " , str ( options . txfee ) )
# Dynamically estimate a realistic fee if it currently is the default value .
# Dynamically estimate a realistic fee.
# At this point we do not know even the number of our own inputs, so
# At this point we do not know even the number of our own inputs, so
# we guess conservatively with 2 inputs and 2 outputs each.
# we guess conservatively with 2 inputs and 2 outputs each.
if options . txfee == - 1 :
fee_per_cp_guess = estimate_tx_fee ( 2 , 2 , txtype = " p2sh-p2wpkh " )
options . txfee = max ( options . txfee , estimate_tx_fee ( 2 , 2 ,
txtype = " p2sh-p2wpkh " ) )
log . debug ( " Estimated miner/tx fee for each cj participant: " + str (
log . debug ( " Estimated miner/tx fee for each cj participant: " + str (
options . txfee ) )
fee_per_cp_guess ) )
assert ( options . txfee > = 0 )
maxcjfee = ( 1 , float ( ' inf ' ) )
maxcjfee = ( 1 , float ( ' inf ' ) )
if not options . p2ep and not options . pickorders and options . makercount != 0 :
if not options . p2ep and not options . pickorders and options . makercount != 0 :
@ -176,7 +173,7 @@ def main():
total_cj_amount = wallet_service . get_balance_by_mixdepth ( ) [ options . mixdepth ]
total_cj_amount = wallet_service . get_balance_by_mixdepth ( ) [ options . mixdepth ]
if total_cj_amount == 0 :
if total_cj_amount == 0 :
raise ValueError ( " No confirmed coins in the selected mixdepth. Quitting " )
raise ValueError ( " No confirmed coins in the selected mixdepth. Quitting " )
exp_tx_fees_ratio = ( ( 1 + options . makercount ) * options . txfee ) / total_cj_amount
exp_tx_fees_ratio = ( ( 1 + options . makercount ) * fee_per_cp_guess ) / total_cj_amount
if exp_tx_fees_ratio > 0.05 :
if exp_tx_fees_ratio > 0.05 :
jmprint ( ' WARNING: Expected bitcoin network miner fees for this coinjoin '
jmprint ( ' WARNING: Expected bitcoin network miner fees for this coinjoin '
' amount are roughly {:.1%} ' . format ( exp_tx_fees_ratio ) , " warning " )
' amount are roughly {:.1%} ' . format ( exp_tx_fees_ratio ) , " warning " )