簡體   English   中英

新的arg在不同的arg上生成錯誤

[英]New arg generates error on different arg

我已經在這里待了兩天了。 該代碼新增了CreateTransaction的第7個arg,並且已成功在程序中的其他地方使用。

在FundTransaction中,使用以下內容創建一個空字符串。

std::string strTxComment;

然后將其傳遞給。

CreateTransaction(vecSend, wtx, reservekey, nFeeRet, nChangePosRet, strFailReason, strTxComment, coinControl, false)

里面有定義。

bool CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, int& nChangePosRet, std::string& strFailReason, std::string strTxComment, const CCoinControl *coinControl = NULL, bool sign = true);

然后,我們得到以下錯誤,該錯誤抱怨第9個arg而不是新的第7個strTxComment arg。

wallet/wallet.cpp: In member function ‘bool CWallet::FundTransaction(CMutableTransaction&, CAmount&, int&, std::string&, bool)’:
wallet/wallet.cpp:1927:125: error: no matching function for call to ‘CWallet::CreateTransaction(std::vector<CRecipient>&, CWalletTx&, CReserveKey&, CAmount&, int&, std::string&, std::string&, CCoinControl&, bool)’
 if (!CreateTransaction(vecSend, wtx, reservekey, nFeeRet, nChangePosRet, strFailReason, strTxComment, coinControl, false))
                                                                                                                         ^
wallet/wallet.cpp:1927:125: note: candidate is:
In file included from wallet/wallet.cpp:6:0:
./wallet/wallet.h:670:10: note: bool CWallet::CreateTransaction(const std::vector<CRecipient>&, CWalletTx&, CReserveKey&, CAmount&, int&, std::string&, std::string&, const CCoinControl*, bool)
 bool CreateTransaction(const std::vector<CRecipient>& vecSend, CWalletTx& wtxNew, CReserveKey& reservekey, CAmount& nFeeRet, int& nChangePosRet, std::string& strFailReason, std::string strTxComment, const CCoinControl *coinControl = NULL, bool sign = true);
      ^
./wallet/wallet.h:670:10: note:   no known conversion for argument 8 from ‘CCoinControl’ to ‘const CCoinControl*’

將更改之前的代碼還原為CreateTransaction,然后FundTransaction以完全相同的方式調用它,而無需更改coinControl參數。

我不期望有解決方案,但是由於我非常受阻,目前我需要一些幫助。

您沒有向我們顯示coinControl,但似乎不是指針。 嘗試發送

&coinControl

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM