From 3bf999989d35bc4e1249298c7d6e268a6fbacc6e Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 6 Jul 2019 00:26:28 -1100 Subject: [PATCH] ) --- src/komodo_nSPV_superlite.h | 4 ++-- src/rpc/rawtransaction.cpp | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/komodo_nSPV_superlite.h b/src/komodo_nSPV_superlite.h index 35da59efd..a2f80b79e 100644 --- a/src/komodo_nSPV_superlite.h +++ b/src/komodo_nSPV_superlite.h @@ -390,14 +390,14 @@ UniValue NSPV_broadcast(char *hex) decode_hex(data,n,hex); _txid = bits256_doublesha256(0,data,n); for (i=0; i<32; i++) - ((uint8_t *)&txid[i] = _txid.bytes[31 - i]; + ((uint8_t *)&txid)[i] = _txid.bytes[31 - i]; msg = (uint8_t *)malloc(1 + sizeof(txid) + sizeof(n) + n); msg[len++] = NSPV_BROADCAST; len += iguana_rwbignum(1,&msg[len],sizeof(txid),(uint8_t *)&txid); len += iguana_rwnum(1,&msg[len],sizeof(n),&n); memcpy(&msg[len],data,n), len += n; free(data); - fprintf(stderr,"send txid.%s\n",txid.GetHex().c_str()); + //fprintf(stderr,"send txid.%s\n",txid.GetHex().c_str()); if ( NSPV_req(0,msg,len,NODE_NSPV,msg[0]>>1) != 0 ) { for (i=0; i 2) @@ -1340,8 +1342,12 @@ UniValue sendrawtransaction(const UniValue& params, bool fHelp) } else if (fHaveChain) { throw JSONRPCError(RPC_TRANSACTION_ALREADY_IN_CHAIN, "transaction already in block chain"); } + RelayTransaction(tx); + } + else + { + NSPV_broadcast((char *)params[0].get_str().c_str()); } - RelayTransaction(tx); return hashTx.GetHex(); }