Skip to content

Assertion failed in CWallet::CreateTransactionInternal during sendmany #23353

@lukaszsamson

Description

@lukaszsamson

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]

Oct 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&, 
FeeCalculation&, bool): Assertion `coin_selection_params.m_subtract_fee_outputs || fee_needed <= change_and_fee - change_amount' failed.
Oct 25 10:48:16 myhost.local systemd[1]: bitcoind.service: main process exited, code=killed, status=6/ABRT
Oct 25 10:48:16 myhost.local.local systemd[1]: Unit bitcoind.service entered failed state.
Oct 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

2021-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(
432091txo)
2021-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(
433916txo)
2021-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(
433677txo)
2021-10-25T10:46:18Z BlockUntilSyncedToCurrentChain: txindex is catching up on block notifications
2021-10-25T10:46:18Z [default wallet] AddToWallet(TX redacted)  update
2021-10-25T10:48:15Z [default wallet] keypool added 1 keys (1 internal), size=2000 (1000 internal)
2021-10-25T10:48:15Z [default wallet] keypool reserve 51379

in other cases there was no line with AddToWallet(TX redacted) update

wallet info

bicoin-cli getwalletinfo
{
  "walletname": "",
  "walletversion": 159900,
  "format": "bdb",
  "balance": (redacted),
  "unconfirmed_balance": 0.00000000,
  "immature_balance": 0.00000000,
  "txcount": (redacted),
  "keypoololdest": (redacted),
  "keypoolsize": 1000,
  "hdseedid": (redacted),
  "keypoolsize_hd_internal": 999,
  "unlocked_until": 0,
  "paytxfee": 0.00001000,
  "private_keys_enabled": true,
  "avoid_reuse": false,
  "scanning": false,
  "descriptors": false
}

When retried after restart the same transaction is submitted with no problems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions