After upgrade of binary bitcoind from 0.19.1 to 0.20.0 could not process transactions. Did not see anything in release notes that would be breaking. Any idea what could be the issue? I cant find any documentation on this error message.

**Expected behavior**

Process transaction without error using "sendtoaddress"

**Actual behavior**

error code -4 "Transaction fee and change calculation failed"

**To reproduce**

All we did was upgrade binary bitcoind from 0.19.1 to v0.20.0. Nothing else changed.

**System information**

Using binary from https://bitcoincore.org/bin/bitcoin-core-0.20.0/bitcoin-0.20.0-x86_64-linux-gnu.tar.gz

On Linux Ubuntu 18.04.3 LTS on a SSD

No ERRORs exist in debug.log. Node syncs fine on v0.20.0... The following seems relevant but we saw same logs on v0.19.1.

**v0.19.1...**

2020-06-09T07:51:36Z [default wallet] Fee Calculation: Fee:2871 Bytes:136 Needed:2871 Tgt:6 (requested 6) Reason:"Conservative Double Target longer horizon" Decay 0.99931: Estimation: (20593.8 - 21623.5) 97.20% 37504.3/(38582.5 0 mem 3.0 out) Fail: (19613.1 - 20593.8) 92.07% 24792.5/(26908.8 0 mem 19.2 out)
2020-06-09T07:54:32Z [default wallet] Fee Calculation: Fee:13110 Bytes:621 Needed:13110 Tgt:6 (requested 6) Reason:"Conservative Double Target longer horizon" Decay 0.99931: Estimation: (20593.8 - 21623.5) 97.20% 37504.3/(38582.5 0 mem 3.0 out) Fail: (19613.1 - 20593.8) 92.07% 24792.5/(26908.8 0 mem 19.2 out)
2020-06-09T09:58:09Z [default wallet] Fee Calculation: Fee:7326 Bytes:347 Needed:7326 Tgt:6 (requested 6) Reason:"Conservative Double Target longer horizon" Decay 0.99931: Estimation: (20593.8 - 21623.5) 97.39% 40008.9/(41076.7 0 mem 3.0 out) Fail: (19613.1 - 20593.8) 92.28% 25270.9/(27366.8 0 mem 19.0 out)
2020-06-09T13:22:31Z [default wallet] Fee Calculation: Fee:16956 Bytes:803 Needed:16956 Tgt:6 (requested 6) Reason:"Conservative Double Target longer horizon" Decay 0.99931: Estimation: (20593.8 - 21623.5) 97.64% 43671.2/(44725.9 0 mem 3.0 out) Fail: (19613.1 - 20593.8) 92.48% 25689.0/(27759.1 0 mem 18.8 out)
2020-06-09T14:36:45Z [default wallet] Fee Calculation: Fee:54877 Bytes:2255 Needed:54877 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (23839.9 - 25031.9) 98.23% 3643.5/(3709.2 0 mem 0.0 out) Fail: (22704.7 - 23839.9) 81.84% 2485.0/(3036.6 0 mem 0.0 out)
2020-06-09T15:33:30Z [default wallet] Fee Calculation: Fee:5709 Bytes:258 Needed:5709 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (21623.5 - 22704.7) 88.84% 3368.3/(3791.3 0 mem 0.0 out) Fail: (20593.8 - 21623.5) 77.45% 3045.0/(3928.4 0 mem 3.2 out)
2020-06-09T16:06:13Z [default wallet] Fee Calculation: Fee:90020 Bytes:4068 Needed:90020 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (21623.5 - 22704.7) 88.87% 3127.1/(3518.6 0 mem 0.0 out) Fail: (20593.8 - 21623.5) 77.48% 2822.9/(3640.5 0 mem 2.9 out)
2020-06-09T18:16:54Z [default wallet] Fee Calculation: Fee:7683 Bytes:347 Needed:7683 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (21623.5 - 22704.7) 92.06% 3166.4/(3439.3 0 mem 0.0 out) Fail: (20593.8 - 21623.5) 82.08% 2307.7/(2809.5 0 mem 2.1 out)
2020-06-09T18:28:31Z [default wallet] Fee Calculation: Fee:11759 Bytes:531 Needed:11759 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (21623.5 - 22704.7) 92.58% 3152.3/(3404.9 0 mem 0.0 out) Fail: (20593.8 - 21623.5) 82.64% 2219.5/(2683.9 0 mem 2.0 out)
2020-06-09T18:53:50Z [default wallet] Fee Calculation: Fee:11716 Bytes:529 Needed:11716 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (21623.5 - 22704.7) 93.28% 3003.3/(3219.7 0 mem 0.0 out) Fail: (20593.8 - 21623.5) 83.47% 2016.6/(2414.3 0 mem 1.7 out)
2020-06-09T19:18:43Z [default wallet] Fee Calculation: Fee:4962 Bytes:224 Needed:4962 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (21623.5 - 22704.7) 93.59% 2925.7/(3126.0 0 mem 0.0 out) Fail: (20593.8 - 21623.5) 83.74% 1903.9/(2272.0 0 mem 1.6 out)

**v0.20.0 ...**

2020-06-09T20:18:06Z [default wallet] Fee Calculation: Fee:2829 Bytes:134 Needed:2829 Tgt:6 (requested 6) Reason:"Conservative Double Target longer horizon" Decay 0.99931: Estimation: (20593.8 - 21623.5) 97.79% 45111.8/(46130.7 0 mem 2.9 out) Fail: (19613.1 - 20593.8) 93.00% 26822.9/(28822.8 0 mem 18.2 out)

**v0.19.1...**

2020-06-09T21:44:39Z [default wallet] Fee Calculation: Fee:7372 Bytes:349 Needed:7372 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (20593.8 - 21623.5) 91.12% 2121.8/(2327.6 0 mem 0.9 out) Fail: (19613.1 - 20593.8) 83.14% 777.5/(935.0 0 mem 0.1 out)
2020-06-09T21:45:57Z [default wallet] Fee Calculation: Fee:7330 Bytes:347 Needed:7330 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (20593.8 - 21623.5) 91.12% 2121.8/(2327.6 0 mem 0.9 out) Fail: (19613.1 - 20593.8) 83.14% 777.5/(935.0 0 mem 0.1 out)
2020-06-09T21:50:48Z [default wallet] Fee Calculation: Fee:36125 Bytes:1710 Needed:36125 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (20593.8 - 21623.5) 91.12% 2121.8/(2327.6 0 mem 0.9 out) Fail: (19613.1 - 20593.8) 83.14% 777.5/(935.0 0 mem 0.1 out)
2020-06-09T22:04:02Z [default wallet] Fee Calculation: Fee:4775 Bytes:226 Needed:4775 Tgt:6 (requested 6) Reason:"Target 85% Threshold" Decay 0.96200: Estimation: (20593.8 - 21623.5) 92.53% 2369.9/(2560.4 0 mem 0.8 out) Fail: (19613.1 - 20593.8) 84.30% 783.4/(929.1 0 mem 0.1 out)

std::string m_name;
    
    std::unique_ptr<WalletDatabase> const m_database;
    /**
     * The following is used to keep track of how far behind the wallet is
     * from the chain sync, and to allow clients to block on us being caught up.
     *
     * Processed hash is a pointer on node's tip and doesn't imply that the wallet
     * has scanned sequentially all blocks up to this one.
     */
    uint256 m_last_block_processed GUARDED_BY(cs_wallet);
    /* Height of last block processed is used by wallet to know depth of transactions
     * without relying on Chain interface beyond asynchronous updates. For safety, we
     * initialize it to -1. Height is a pointer on node's tip and doesn't imply
     * that the wallet has scanned sequentially all blocks up to this one.
     */
    int m_last_block_processed_height GUARDED_BY(cs_wallet) = -1;
    std::map<OutputType, ScriptPubKeyMan*> m_external_spk_managers;
    std::map<OutputType, ScriptPubKeyMan*> m_internal_spk_managers;
    
    
    std::map<uint256, std::unique_ptr<ScriptPubKeyMan>> m_spk_managers;
    bool CreateTransactionInternal(const std::vector<CRecipient>& vecSend, CTransactionRef& tx, CAmount& nFeeRet, int& nChangePosInOut, bilingual_str& error, const CCoinControl& coin_control, FeeCalculation& fee_calc_out, bool sign);
public:
    /*
     * Main wallet lock.
     * This lock protects all the fields added by CWallet.
     */
    mutable RecursiveMutex cs_wallet;
    WalletDatabase& GetDatabase() const override