Skip to content

Conversation

@gavinandresen
Copy link
Contributor

This is 'a python geeks coin control.'

Should be both useful and also a good demonstration of using the raw transactions API.

Should be both useful and also a pretty good demonstration of
using the raw transactions API.
@gmaxwell
Copy link
Contributor

gmaxwell commented Jan 7, 2013

In my own python scripts I've never been clear about this— and hand't bothered to try to test it— can the cast from Decimal to float and then transmission to bitcoind result in turning 1e-8 BTC to fees due to rounding?

@BitcoinPullTester
Copy link

@gavinandresen
Copy link
Contributor Author

@gmaxwell:

Cast from Decimal to float will be safe as long as floats are 64 bits. Checking for that is a good idea: "information about the precision and internal representation of floating point numbers for the machine on which your program is running is available in sys.float_info."

... or maybe more straightforward (and more easily portable to other languages) would be a check routine that takes Decimal("20000000.00000003"), converts it to float, json encode/decode, and makes sure precision is not lost in the round-trip.

mmm, yeah, json encode/decode definitely better, because the json float encoder might decide to round/truncate...

@gavinandresen
Copy link
Contributor Author

Closing this for now; I found a nasty bug doing more testing (on testnet-- using same address as input and output could lose coins to fees).

I'm going to rework to sanity-check fees on the final transaction and write a test plan.

owlhooter pushed a commit to owlhooter/mazacoin-new that referenced this pull request Oct 11, 2018
* Update release notes

* add 2157
guruvan added a commit to guruvan/maza that referenced this pull request Nov 8, 2018
* MAZA-POS: (5575 commits)
  Mazafication of code More mazafication More mazafications and compile correction fixes fix for build issues fix for build issues fix string in net.cpp correct pow.cpp correct validation.cpp fixing for build errors fix typo Merge remote-tracking branch 'origin/MAZA-POS' into MAZA-POS
  merge to dash rebase
  Release notes 0.12.3.3
  Remove redundant parameter fCheckDuplicateInputs from CheckTransaction
  Fix crash bug with duplicate inputs within a transaction
  Bump to 0.12.3.3
  Release notes 0.12.3.2 (bitcoin#2174)
  Add tests for special rules for slow blocks on devnet/testnet (bitcoin#2176)
  Allow mining min diff for very slow (2h+) blocks (bitcoin#2175)
  Fix issues with selections on Masternode tab (bitcoin#2170)
  Sync mn list and mnw list from 3 peers max (bitcoin#2169)
  A few devnet related fixes (bitcoin#2168)
  Adjust diff for slow testnet/devnet blocks a bit smoother (bitcoin#2161)
  Make PS Buttons not react to spacebar (bitcoin#2154)
  Bump to 0.12.3.2 (bitcoin#2173)
  Bump to 0.12.3.1 (bitcoin#2158)
  Update release notes (bitcoin#2155)
  Use correct protocol when serializing messages in reply to `getdata` (bitcoin#2157)
  Fix p2pkh tests asserts (bitcoin#2153)
  Fix block value/payee validation in lite mode (bitcoin#2148)
  ...
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants