|
|
|
|
@ -842,12 +842,12 @@ class BitcoinCoreInterface(BlockchainInterface):
|
|
|
|
|
def estimate_fee_per_kb(self, N): |
|
|
|
|
if super(BitcoinCoreInterface, self).fee_per_kb_has_been_manually_set(N): |
|
|
|
|
return int(random.uniform(N * float(0.8), N * float(1.2))) |
|
|
|
|
estimate = int(Decimal(1e8) * Decimal(self.rpc('estimatefee', [N]))) |
|
|
|
|
estimate = int(Decimal(1e8) * Decimal(self.rpc('estimatesmartfee', [N])['feerate'])) |
|
|
|
|
if (N == 1) and (estimate < 0): |
|
|
|
|
# Special bitcoin core case: sometimes the highest priority |
|
|
|
|
# cannot be estimated in that case the 2nd highest priority |
|
|
|
|
# should be used instead of falling back to hardcoded values |
|
|
|
|
estimate = int(Decimal(1e8) * Decimal(self.rpc('estimatefee', [N+1]))) |
|
|
|
|
estimate = int(Decimal(1e8) * Decimal(self.rpc('estimatesmartfee', [N+1])['feerate'])) |
|
|
|
|
if estimate < 0: |
|
|
|
|
# This occurs when Core has insufficient data to estimate. |
|
|
|
|
return 100000 |
|
|
|
|
|