diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 033ba13d48a7..3faf1d77eb0d 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -499,9 +499,8 @@ WalletModel::SendCoinsReturn WalletModel::sendCoins(WalletModelTransaction& tran return SendCoinsReturn(res); } - CTransaction* t = (CTransaction*)newTx; CDataStream ssTx(SER_NETWORK, PROTOCOL_VERSION); - ssTx << *t; + ssTx << *(newTx->tx); transaction_array.append(&(ssTx[0]), ssTx.size()); } diff --git a/src/qt/walletmodeltransaction.cpp b/src/qt/walletmodeltransaction.cpp index 610c4ef0029b..fe9debc89af5 100644 --- a/src/qt/walletmodeltransaction.cpp +++ b/src/qt/walletmodeltransaction.cpp @@ -38,7 +38,7 @@ void WalletModelTransaction::setTransaction(CWalletTx* tx) unsigned int WalletModelTransaction::getTransactionSize() { - return (!walletTransaction ? 0 : (::GetSerializeSize(*(CTransaction*)walletTransaction, SER_NETWORK, PROTOCOL_VERSION))); + return (!walletTransaction ? 0 : (::GetSerializeSize(*(walletTransaction->tx), SER_NETWORK, PROTOCOL_VERSION))); } CAmount WalletModelTransaction::getTransactionFee()