Return txid even if ATMP fails for new transaction

This commit is contained in:
Pieter Wuille 2016-12-08 11:49:28 -08:00
parent 86017842d6
commit b3a74100b8
1 changed files with 4 additions and 4 deletions

View File

@ -2580,11 +2580,11 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CCon
{ {
// Broadcast // Broadcast
if (!wtxNew.AcceptToMemoryPool(maxTxFee, state)) { if (!wtxNew.AcceptToMemoryPool(maxTxFee, state)) {
// This must not fail. The transaction has already been signed and recorded. LogPrintf("CommitTransaction(): Transaction cannot be broadcast immediately, %s\n", state.GetRejectReason());
LogPrintf("CommitTransaction(): Error: Transaction not valid, %s\n", state.GetRejectReason()); // TODO: if we expect the failure to be long term or permanent, instead delete wtx from the wallet and return failure.
return false; } else {
wtxNew.RelayWalletTransaction(connman);
} }
wtxNew.RelayWalletTransaction(connman);
} }
} }
return true; return true;