Since few days my mainnet node is crashing when sending a transaction(s).
Expected behavior
No crash
Actual behavior
when calling sendmany via JSON RPC
with params: ["", {(redacted): (redacted)}, null, null, null, true]
0Oct 25 10:48:16 myhost.local bitcoind[11906]: bitcoind: wallet/spend.cpp:783: bool CWallet::CreateTransactionInternal(const std::vector<CRecipient>&, CTransactionRef&, CAmount&, int&, bilingual_str&, const CCoinControl&,
1FeeCalculation&, bool): Assertion `coin_selection_params.m_subtract_fee_outputs || fee_needed <= change_and_fee - change_amount' failed.
2Oct 25 10:48:16 myhost.local systemd[1]: bitcoind.service: main process exited, code=killed, status=6/ABRT
3Oct 25 10:48:16 myhost.local.local systemd[1]: Unit bitcoind.service entered failed state.
4Oct 25 10:48:16 myhost.local.local systemd[1]: bitcoind.service failed.
To reproduce
Not sure
System information
22.0 official build (https://bitcoincore.org/bin/bitcoin-core-22.0/bitcoin-22.0-x86_64-linux-gnu.tar.gz)
Linux centos 7, x64, AWS EBS
debug.log just before the crash
02021-10-25T10:44:48Z UpdateTip: new best=0000000000000000000843e96d7018b2d4ff86b1d43c6b83bcd3b80a804ff666 height=706607 version=0x20002004 log2_work=93.137445 tx=681104170 date='2021-10-25T10:44:30Z' progress=1.000000 cache=56.5MiB(
1432091txo)
22021-10-25T10:45:53Z UpdateTip: new best=00000000000000000006ca3ee822d8ca2a74022721d37f04ffaf5c218b14625c height=706608 version=0x20000004 log2_work=93.137457 tx=681105856 date='2021-10-25T10:45:34Z' progress=1.000000 cache=56.7MiB(
3433916txo)
42021-10-25T10:46:18Z UpdateTip: new best=00000000000000000001c9f7f7a1f1862d78ed6a25686c7c06fcd3d322fac84c height=706609 version=0x20c00004 log2_work=93.137468 tx=681107058 date='2021-10-25T10:45:54Z' progress=1.000000 cache=56.7MiB(
5433677txo)
62021-10-25T10:46:18Z BlockUntilSyncedToCurrentChain: txindex is catching up on block notifications
72021-10-25T10:46:18Z [default wallet] AddToWallet(TX redacted) update
82021-10-25T10:48:15Z [default wallet] keypool added 1 keys (1 internal), size=2000 (1000 internal)
92021-10-25T10:48:15Z [default wallet] keypool reserve 51379
in other cases there was no line with AddToWallet(TX redacted) update
wallet info
0bicoin-cli getwalletinfo
1{
2 "walletname": "",
3 "walletversion": 159900,
4 "format": "bdb",
5 "balance": (redacted),
6 "unconfirmed_balance": 0.00000000,
7 "immature_balance": 0.00000000,
8 "txcount": (redacted),
9 "keypoololdest": (redacted),
10 "keypoolsize": 1000,
11 "hdseedid": (redacted),
12 "keypoolsize_hd_internal": 999,
13 "unlocked_until": 0,
14 "paytxfee": 0.00001000,
15 "private_keys_enabled": true,
16 "avoid_reuse": false,
17 "scanning": false,
18 "descriptors": false
19}
When retried after restart the same transaction is submitted with no problems.