avoid undefined behaviour
TODO: use boost::lexical_cast or C++11 std::to_string
This commit is contained in:
parent
d068681283
commit
21a7bae2f1
|
@ -1448,7 +1448,8 @@ NAN_METHOD(SendTransaction) {
|
||||||
// Attempt to add the transaction to the mempool
|
// Attempt to add the transaction to the mempool
|
||||||
if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, !allowAbsurdFees)) {
|
if (!AcceptToMemoryPool(mempool, state, tx, false, &fMissingInputs, !allowAbsurdFees)) {
|
||||||
if (state.IsInvalid()) {
|
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());
|
sprintf(errorMessage, "%i: %s", state.GetRejectCode(), state.GetRejectReason().c_str());
|
||||||
return NanThrowError(errorMessage);
|
return NanThrowError(errorMessage);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue