avoid undefined behaviour

TODO: use boost::lexical_cast or C++11 std::to_string
This commit is contained in:
Isidoro Ghezzi 2015-09-04 19:24:12 +02:00
parent d068681283
commit 21a7bae2f1
1 changed files with 2 additions and 1 deletions

View File

@ -1448,7 +1448,8 @@ NAN_METHOD(SendTransaction) {
// Attempt to add the transaction to the mempool
if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, !allowAbsurdFees)) {
if (state.IsInvalid()) {
char *errorMessage;
// TODO: use boost::lexical_cast or C++11 std::to_string
char errorMessage [1024];
sprintf(errorMessage, "%i: %s", state.GetRejectCode(), state.GetRejectReason().c_str());
return NanThrowError(errorMessage);
} else {