Published on: 2011-09-03T14:16:40+00:00
During a discussion on the #bitcoin-dev forum, a user named Chris Double raised a question about the correct usage of casting in relation to the CWalletTxn size. He wondered if he was misreading the code or if he was suffering from late night programmer syndrome. After further conversation, it was determined that Double's belief that the GetSerializeSize method in CTransaction and CWalletTxn were virtual was incorrect. As a result, there was no issue and no cause for concern.Upon closer examination of the code in CWallet::CreateTransaction, it was noticed that line 979 contains a call to the 'GetSerializeSize' function. This function is responsible for checking whether the transaction size exceeds the maximum block size allowed. If the size surpasses the limit, the function will return false. Additionally, there is a code block that calculates the priority of the transaction. This is done by dividing the transaction's priority by its size in bytes.To refer to the specific code mentioned, you can follow this link: [https://github.com/bitcoin/bitcoin/blob/master/src/wallet.cpp#L979].
Updated on: 2023-08-01T02:22:40.444565+00:00