1 2017-02-24 12:23:37 <emzy> so mal poloniex passwort geändert...
  2 2017-02-24 12:24:16 <emzy> wrong channel.
  3 2017-02-24 19:00:25 <bsm117532> In regtest mode, `generate` and `generatetoaddress` do not actually mine any transactions from the mempool.  What's the best way to generate a block containing my mempool transactions?
  4 2017-02-24 19:02:01 <waxwing> bsm117532: 'generate' should work? my txs are always mined when i do that
  5 2017-02-24 19:02:31 <waxwing> hmm, maybe there's some detail i'm overlooking
  6 2017-02-24 19:02:35 <achow101> bsm117532: both should mine transactions from the mempool, they're based on the same code IIRC
  7 2017-02-24 19:04:15 <bsm117532> Looking at src/rpc/mining.cpp it doesn't look like it gets anything from the mempool.  (And I'm asking because I have ~130 txns in my mempool and none in my blocks)
  8 2017-02-24 19:04:49 <arubi> it should mine transactions from your mempool with 'generate'
  9 2017-02-24 19:05:05 <bsm117532> Hmmm then what could I be doing wrong?
 10 2017-02-24 19:05:20 <arubi> special settings?  abnormal transactions?
 11 2017-02-24 19:05:25 <waxwing> try the viabtc accelerator?
 12 2017-02-24 19:05:28 <waxwing> :)
 13 2017-02-24 19:05:29 <arubi> hehe
 14 2017-02-24 19:06:06 <bsm117532> They're segwit txns, maybe that's the problem...
 15 2017-02-24 19:06:25 <arubi> at which block height are you?
 16 2017-02-24 19:06:26 <achow101> bsm117532: blocks are built here: https://github.com/bitcoin/bitcoin/blob/668de70be039a4f1ffcf20aeae2a22ee71fc55a8/src/miner.cpp#L130
 17 2017-02-24 19:06:27 <waxwing> oh i think there's some high number of blocks you need upfront
 18 2017-02-24 19:06:37 <bsm117532> But I'm running with -bip9params=segwit:0.0 -prematurewitness -walletprematurewitness
 19 2017-02-24 19:06:40 <waxwing> yeah i remember back in the segnet days it was like 500 or something
 20 2017-02-24 19:06:46 <achow101> IIRC you only need 288 blocks for segwit to activate on regtest
 21 2017-02-24 19:07:18 <bsm117532> Even with that I'm at block 909 and it's still not mining my txns...
 22 2017-02-24 19:08:02 <arubi> are these just "normal" segwit transactions?  you have nothing set for 'maxblockweight' or 'maxblocksize' ?
 23 2017-02-24 19:08:40 <bsm117532> I've not touched those parameters.
 24 2017-02-24 19:08:51 <bsm117532> The txns might be considered nonstandard...
 25 2017-02-24 19:09:56 <arubi> so last time I got my regtest to fail to include tx in blocks was when I had conflicting settings for maxweight\maxsize.  these were also "nonstandard" segwit transactions
 26 2017-02-24 19:10:47 <achow101> I thought on regtest non-standard transactions can still be confirmed
 27 2017-02-24 19:11:01 <achow101> (they are still accepted and mined by core)
 28 2017-02-24 19:12:04 <arubi> yea, for me I had maxblockweight=4000000 , maxblocksize=1000000, so some very big segwit transactions got into the node's mempool, but didn't get included in any blocks
 29 2017-02-24 19:12:45 <bsm117532> Here's one: https://www.zerobin.net/?7b6b719543a3ed60#n8645xLYrkK2t5yDhXcUCFKfzGBADqJxTqGZg72TL6U=
 30 2017-02-24 19:13:48 <arubi> looks pretty normal
 31 2017-02-24 19:14:28 <bsm117532> @arubi I'm using the defaults for those parameters, so maxblockweight=3000000 maxblocksize=750000
 32 2017-02-24 19:15:30 <achow101> your tranasction is spending from a witness output, so the transaction before it had to also confirm
 33 2017-02-24 19:16:18 <bsm117532> This is a segwit-only regtest, I'm using generatetoaddress directly to a segwit address
 34 2017-02-24 19:16:45 <arubi> well p2sh(segwit)
 35 2017-02-24 19:17:41 <arubi> you can use bare scripts for segwit stuff, so you don't need to have the p2sh preimage in scriptsig
 36 2017-02-24 19:17:54 <arubi> saves some precious bytes, especially if it's p2wsh :)
 37 2017-02-24 19:19:43 <arubi> are these 0 fee by any chance?
 38 2017-02-24 19:30:12 <bsm117532> I am using bare segwit scripts, though the wallet has its coinbasae funds in a p2wsh
 39 2017-02-24 19:30:22 <bsm117532> Good question about the fees...checking...
 40 2017-02-24 19:34:17 <bsm117532> No they're not zero fee...
 41 2017-02-24 19:55:29 <arubi> weird.  anything interesting on the 'getmempoolentry <txid>' output?
 42 2017-02-24 19:56:50 <arubi> wonder if they're all depending on some initial one that's not confirmed.  here is p2sh(p2wpkh) sending to p2wpkh and change to p2pkh.  is the input from a block reward?
 43 2017-02-24 20:00:46 <arubi> do the transactions even appear in 'getblocktemplate '{"rules":["segwit"]}'' ?
 44 2017-02-24 20:03:01 <bsm117532> Nothing obvious in getmempoolentry
 45 2017-02-24 20:03:24 <bsm117532> getblocktemplate has no transactions, adding the "rules" doesn't change that...
 46 2017-02-24 20:03:55 <arubi> so you have transactions in your mempool but not in blocktemplate?  sounds like a bug :)
 47 2017-02-24 20:04:28 <arubi> I mean, what's the use of a transaction in mempool if it can't be mined?
 48 2017-02-24 20:04:38 <bsm117532> Bah!  I don't have time for a bug!  :-(
 49 2017-02-24 20:04:44 <bsm117532> But yeah...
 50 2017-02-24 20:05:09 <arubi> actually it's the same scenario I had with the sizes.  wonder what's causing it.  wanna share the chain?
 51 2017-02-24 20:05:23 <arubi> I wanna look at it a bit later
 52 2017-02-24 20:06:12 <achow101> bsm117532: what version of core are you using?
 53 2017-02-24 20:06:26 <bsm117532> 13.2
 54 2017-02-24 20:07:21 <bsm117532> I'll make a tarball
 55 2017-02-24 20:15:01 <bsm117532> @arubi here is a tarball with a mempool that mines empty blocks: https://github.com/VidaID/bitcoin/blob/segwit-emptyblocks/regtest.tar.bz2
 56 2017-02-24 20:15:35 <arubi> thanks!  I'll be checking it out a bit later
 57 2017-02-24 20:16:09 <bsm117532> Thanks!  Please ping me if you discover anything.  I need to get this to mine blocks, like now so I'm going to keep beating on it.
 58 2017-02-24 20:17:40 <arubi> no problem
 59 2017-02-24 20:18:39 <achow101> bsm117532: I can't replicate this on a build of master (I tried basically exactly your example transaction but with my addresses). can you try using 0.14.0rc2 or build master?
 60 2017-02-24 20:18:56 <bsm117532> sure
 61 2017-02-24 20:19:17 <bsm117532> Did you use generatetoaddress with a segwit address too?
 62 2017-02-24 20:19:34 <achow101> yes
 63 2017-02-24 20:19:41 <bsm117532> It might have something to do with the structure of these transactions then.
 64 2017-02-24 20:19:53 <bsm117532> I'll try again with the tip of master.
 65 2017-02-24 20:24:59 <achow101> -j32, that seems a bit excessive
 66 2017-02-24 20:25:13 <achow101> where do you get a 32 core machine?
 67 2017-02-24 20:25:16 <bsm117532> dual socket, 32 cores.
 68 2017-02-24 20:25:28 <bsm117532> Compiles bitcoin in 1:30.
 69 2017-02-24 20:42:45 <bsm117532> @achow101 same problem on master, `getmininginfo` shows nonzero pooledtx, but getblocktemplate has zero transactions.
 70 2017-02-24 20:44:45 <achow101> did generate include the transaction?
 71 2017-02-24 20:45:38 <bsm117532> no
 72 2017-02-24 20:46:52 <achow101> hmm. interesting. I can't replicate this though
 73 2017-02-24 20:47:50 <bsm117532> I linked the regtest dir above.  Just untar that file in ~/.bitcoin to see a chain with this problem.
 74 2017-02-24 20:51:15 <achow101> are you sure that there are transactions in the mempool?
 75 2017-02-24 20:52:20 <bsm117532> Yes, `getmininginfo` shows them in `pooledtx` and I can get them directly with getrawtransaction or getmempoolentry
 76 2017-02-24 20:52:38 <bsm117532> One mempool txid you can use if you're examining my tarball is 7c7c8f1d762750a25a721a07fcddf711ed412a9feb7c52a91838114b28f1e1ee
 77 2017-02-24 20:52:46 <achow101> here's your problem. segwit has not activated yet
 78 2017-02-24 20:52:56 <achow101> (at least in the tar)
 79 2017-02-24 20:53:12 <achow101> do `getblockchaininfo` and it will tell you whether it has activated
 80 2017-02-24 20:53:50 <bsm117532> I'm running bitcoind -bip9params=segwit:0:0 -prematurewitness -walletprematurewitness
 81 2017-02-24 20:53:57 <bsm117532> But you're right, it doesn't seem to have activated...
 82 2017-02-24 20:54:05 <bsm117532> What do I need to do to get it to activate?
 83 2017-02-24 20:55:13 <achow101> hmm. with your parameters it is active..
 84 2017-02-24 20:55:26 <achow101> activating it just requires mining a bunch of blocks
 85 2017-02-24 20:55:27 <bsm117532> According to getblockchaininfo it's not though...
 86 2017-02-24 20:55:43 <bsm117532> And I'm at height 655, so that should be higher than the activation anyway...
 87 2017-02-24 20:56:07 <achow101> wait, no. I read that wrong. Segwit isn't even in my getblockchaininfo output
 88 2017-02-24 20:56:53 <bsm117532> YEah not in mine either
 89 2017-02-24 20:57:19 <achow101> I think the problem is with the bip9params option you have set
 90 2017-02-24 20:59:01 <achow101> oh. duh. the bip9 parameters you have set completely disable segwit. it doesn't activate it, it sets the start time for deployment signalling to 0, and then the end time again to 0, so segwit is effectively off
 91 2017-02-24 20:59:30 <bsm117532> Heh okay.  would -bip9params=segwit:0:1 turn it on?
 92 2017-02-24 21:00:10 <achow101> no. just don't set that option. that option doesn't turn on segwit, it just changes the deployment parameters. you still need to mine the blocks to activate it
 93 2017-02-24 21:01:22 <achow101> don't set the option. then mine a few hundred blocks and check that it is listed as active in getblockchaininfo
 94 2017-02-24 21:01:49 <bsm117532> Ok I see.
 95 2017-02-24 21:02:12 <bsm117532> But I think bip9params=segwit:0:1 would turn it on from block 1, no?
 96 2017-02-24 21:02:58 <achow101> then your transactions should work
 97 2017-02-24 21:03:47 <achow101> no. it means that signalling starts at 0, and ends at 1
 98 2017-02-24 21:04:02 <achow101> signalling =\= activation
 99 2017-02-24 21:27:17 <arubi> phew :)
100 2017-02-24 21:28:33 <arubi> I like that even if segwit fails to activate, the transactions are still in mempool hehe
101 2017-02-24 22:09:34 <bsm117532> But does regtest must be doing signaling when it mines, so a 1-block long signaling window should see 100% support, and activate, no?
102 2017-02-24 22:14:14 <achow101> that option isn't for how many blocks are required for signalling. it is for the unixtimestamp of the date signalling can start, and the unix timestamp of the date signalling ends
103 2017-02-24 22:14:25 <bsm117532> aaaaaaaahhhhhhhh
104 2017-02-24 22:14:41 <bsm117532> thanks achow101
105 2017-02-24 22:14:53 <achow101> np