Просмотр исходного кода

darkfid/rpc_tx: Use provided hash() function for hashing transaction.

parazyd 3 лет назад
Родитель
Сommit
17ed4ea5cb
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      bin/darkfid/src/rpc_tx.rs

+ 2 - 2
bin/darkfid/src/rpc_tx.rs

@@ -16,7 +16,7 @@
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  * along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
  */
 
 
-use darkfi_serial::{deserialize, serialize};
+use darkfi_serial::deserialize;
 use log::{error, warn};
 use log::{error, warn};
 use serde_json::{json, Value};
 use serde_json::{json, Value};
 
 
@@ -152,7 +152,7 @@ impl Darkfid {
             return server_error(RpcError::TxBroadcastFail, id, None)
             return server_error(RpcError::TxBroadcastFail, id, None)
         }
         }
 
 
-        let tx_hash = blake3::hash(&serialize(&tx)).to_hex().as_str().to_string();
+        let tx_hash = tx.hash().to_string();
         JsonResponse::new(json!(tx_hash), id).into()
         JsonResponse::new(json!(tx_hash), id).into()
     }
     }
 }
 }