Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update usage of CreateAtomicTxnsWrapper #581

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions routes/atomic_txns.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ func (fes *APIServer) CreateAtomicTxnsWrapper(ww http.ResponseWriter, req *http.
}

// Construct the atomic transactions wrapper transaction type.
txn, totalFees, err := fes.blockchain.CreateAtomicTxnsWrapper(requestData.Transactions, extraData)
txn, totalFees, err := fes.blockchain.CreateAtomicTxnsWrapper(
requestData.Transactions, extraData, fes.backendServer.GetMempool())
if err != nil {
_AddBadRequestError(ww, fmt.Sprintf("CreateAtomicTxnsWrapper: Problem constructing transaction: %v", err))
return
Expand All @@ -80,10 +81,10 @@ func (fes *APIServer) CreateAtomicTxnsWrapper(ww http.ResponseWriter, req *http.
_AddBadRequestError(ww, fmt.Sprint("CreateAtomicTxnsWrapper: Resulting wrapper transaction too large"))
return
}
if txnSizeBytes != 0 && utxoView.GlobalParamsEntry.MinimumNetworkFeeNanosPerKB != 0 {
if txnSizeBytes != 0 && utxoView.GetCurrentGlobalParamsEntry().MinimumNetworkFeeNanosPerKB != 0 {
// Check for overflow or minimum network fee not met.
if totalFees != ((totalFees*1000)/1000) ||
(totalFees*1000)/uint64(txnSizeBytes) < utxoView.GlobalParamsEntry.MinimumNetworkFeeNanosPerKB {
(totalFees*1000)/uint64(txnSizeBytes) < utxoView.GetCurrentGlobalParamsEntry().MinimumNetworkFeeNanosPerKB {
_AddBadRequestError(ww, fmt.Sprint("CreateAtomicTxnsWrapper: Transactions used to construct"+
" atomic transaction do not cumulatively pay sufficient network fees to cover wrapper"))
return
Expand Down
2 changes: 1 addition & 1 deletion scripts/tools/toolslib/offline_basic_transfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func _computeFee(txn *lib.MsgDeSoTxn, feeRateNanosPerKB uint64) (*lib.MsgDeSoTxn
if (uint64(txnWithSigLen)*feeRateNanosPerKB)%1000 != 0 {
feeAmountNanos++
}
txn.TxnFeeNanos = uint64(feeAmountNanos)
lib.UpdateTxnFee(txn, uint64(feeAmountNanos))
}
return txn, nil
}
Expand Down
Loading